Latest 0.1.3
Homepage https://github.com/btadine/MPButton
License MIT
Platforms ios 9.0, requires ARC
Authors

CI Status
Version
License
Platform

Have you ever tried to edit the constraints of the elements inside a UIButton?
Adding new elements without breaking existing layout?
Just make the touchable area bigger?

MPButton is a lightweight class that decorates any UIView adding UIControlEvents (ie. touchUpInside) and customizable touching area. This way, you only need to care about the UI.

As easy as this:

let button = MPButton(decoratedView: MyView(), hitbox: CGSize(width: 250, height: 90))
button.addTarget(self, action: #selector(self.doSomething), for: .touchUpInside)

button.decoratedView.myViewLabel.text = "No need to cast"

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Installation

MPButton is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod "MPButton"

Author

btadine

License

MPButton is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "MPButton",
    "version": "0.1.3",
    "summary": "A generic UIControl decorator that provides an easy way to deal with complex layout inside buttons.",
    "description": "MPButton wraps any view that you provide adding UIControlEvents (ie. touchUpInside)nand custom hit box.",
    "homepage": "https://github.com/btadine/MPButton",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "btadine": "[email protected]"
    },
    "source": {
        "git": "https://github.com/btadine/MPButton.git",
        "tag": "0.1.3"
    },
    "requires_arc": true,
    "platforms": {
        "ios": "9.0"
    },
    "source_files": "MPButton/Classes/MPButton.swift",
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This