Latest 0.1.0
Homepage https://github.com/backslash112/YCStateButton
License MIT
Platforms ios 8.0, requires ARC
Authors

CI Status
Version
License
Platform

A custom control for iOS.

With this control, you can make a selectable view with auto-width easily.

Screenshot

Usage

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

Installation

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

pod "YCStateButton"

Usage

(see sample Xcode project in /Example)

  1. Add two images to the Images.xcassets file and slicing them horizontally.

Screenshot

  1. Use it.
    let stateButton = YCStateButton(frame: CGRectMake(30, 30, 0, 0))
    stateButton.selectedStateBackgroundImage = UIImage(named: "tag_selected_bg")!
    stateButton.unSelectedStateBackgroundImage = UIImage(named: "tag_unselected_bg")!
    stateButton.selectedStatusTitleColor = UIColor.greenColor()
    stateButton.unselectedStatusTitleColor = UIColor.grayColor()
    stateButton.fontSize = 15
    stateButton.setTitle("Superman", forState: UIControlState.Normal)
    self.view.addSubview(stateButton)

Author

Yang Cun, [email protected]

License

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

Latest podspec

{
    "name": "YCStateButton",
    "version": "0.1.0",
    "summary": "UIButton with State Changement",
    "description": "Custom UIButton with State Changement",
    "homepage": "https://github.com/backslash112/YCStateButton",
    "license": "MIT",
    "authors": {
        "backslash112": "[email protected]"
    },
    "source": {
        "git": "https://github.com/backslash112/YCStateButton.git",
        "tag": "0.1.0"
    },
    "platforms": {
        "ios": "8.0"
    },
    "requires_arc": true,
    "source_files": "Pod/Classes/**/*",
    "resource_bundles": {
        "YCStateButton": [
            "Pod/Assets/*.png"
        ]
    }
}

Pin It on Pinterest

Share This