Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
Pod
 
 
 
 
 
 
 
 
 
 

README.md

YCStateButton

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
2. 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, yangcun@live.com

License

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

About

A selectable view with auto-width for iOS.

Resources

License

Packages

No packages published
You can’t perform that action at this time.