BetterSegmentedControl alternatives and similar libraries
Based on the "Switch" category
A segment switcher with dynamic text mask effect
adds Multiple-Selection to the standard UISegmentedControl.
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest. Visit our partner's website for more details.
Do you think we are missing an alternative of BetterSegmentedControl or a related project?
BetterSegmentedControl is an easy to use, customizable replacement for UISegmentedControl and UISwitch written in Swift.
- [x] Can be used as a segmented control or switch
- [x] Plethora of customizable options from colors to insets and radii
- [x] Use icons as segments, or add your own custom segments
- [x] Designable straight in Interface Builder
- [x] Customizable behavior
- [x] Right to left languages support
- iOS 9.0+
- Xcode 8+
BetterSegmentedControl is available through CocoaPods. To install it, simply add the following line to your Podfile:
# Swift 5 pod 'BetterSegmentedControl', '~> 1.2' # Swift 4 pod 'BetterSegmentedControl', '1.0' # Swift 3 / Objective-C pod 'BetterSegmentedControl', '0.8'
If you prefer using Carthage, simply add BetterSegmentedControl to your
# Swift 5 github "gmarm/BetterSegmentedControl" ~> 1.2 # Swift 4 github "gmarm/BetterSegmentedControl" 1.0 # Swift 3 / Objective-C github "gmarm/BetterSegmentedControl" 0.8
If you prefer not to use CocoaPods or Carthage, you can integrate BetterSegmentedControl into your project manually.
let control = BetterSegmentedControl( frame: CGRect(x: 0, y: 0, width: 300, height: 44), segments: LabelSegment.segments(withTitles: ["One", "Two", "Three"], normalFont: UIFont(name: "HelveticaNeue-Light", size: 14.0)!, normalTextColor: .lightGray, selectedFont: UIFont(name: "HelveticaNeue-Bold", size: 14.0)!, selectedTextColor: .white), index: 1, options: [.backgroundColor(.darkGray), .indicatorViewBackgroundColor(.blue)]) control.addTarget(self, action: #selector(ViewController.controlValueChanged(_:)), for: .valueChanged) view.addSubview(control)
You can find different ways of using it (such as by designing it in a Storyboard file) in the example project. To run the example project, clone the repo, and run
pod install from the Example directory first.
Feel free to Fork, submit Pull Requests or send me your feedback and suggestions! Please make sure that tests are passing before submitting a new Pull Request.
- CocoaPods version 1.5+ breaks
IBDesignablesupport. If you need
IBDesignablesupport stick to CocoaPods version 1.4 for now.
BetterSegmentedControl is available under the MIT license. See the LICENSE file for more info.
*Note that all licence references and agreements mentioned in the BetterSegmentedControl README section above are relevant to that project's source code only.