TestsTested | ✗ |
LangLanguage | SwiftSwift |
License | MIT |
ReleasedLast Release | Apr 2016 |
SPMSupports SPM | ✗ |
Maintained by rb_de0.
RBSegmentedControl is a subclass of UIView like UISegmentedControl. You can customize some colors. Also, It supports AutoLayout. So, you can use this on the UIStoryBoards.
RBSegmentedControl is available through CocoaPods. To install it, simply add the following line to your Podfile:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!
pod 'RBSegmentedControl'
To run the example project, clone the repo, and run pod install
from the Example directory first.
Sample of simple handling.
class ViewController: UIViewController, RBSegmentedControlDelegate {
@IBOutlet weak var segmentedControl: RBSegmentedControl!
override func viewDidLoad() {
super.viewDidLoad()
segmentedControl.addSegments("TITLE1", "TITLE2", "TITLE3")
segmentedControl.delegate = self
}
func rb_segmentedControl(didChangedSelectedIndex index: Int) {
print(index)
}
}
RBSegmentedControl is available under the MIT license. See the LICENSE file for more info.