AIFlatSwitch alternatives and similar libraries
Based on the "Switch" category.
Alternatively, view AIFlatSwitch alternatives based on common mentions on social networks and blogs.
-
RAMPaperSwitch
:octocat: ๐ RAMPaperSwitch is a Swift material design UI module which paints over the parent view when the switch is turned on. iOS library by @Ramotion -
SJFluidSegmentedControl
A segmented control with custom appearance and interactive animations. Written in Swift 3.0. -
MultiSelectSegmentedControl
UISegmentedControl remake that supports selecting multiple segments, vertical stacking, combining text and images.
SaaSHub - Software Alternatives and Reviews
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of AIFlatSwitch or a related project?
README
AIFlatSwitch
A smooth, nice looking and IBDesignable flat design switch for iOS. Can be used instead of UISwitch.
Inspired by Creativedash's Dribbble post here
Requirements
- iOS 8.0+, tvOS 12.0+
- Xcode 11.0+
- Swift 5
Usage
Creating the flat switch
- Either programmatically
var flatSwitch = AIFlatSwitch(frame: CGRectMake(0, 0, 50, 50))
- Or in Interface Builder
Methods
To change its selected state:
flatSwitch.isSelected = true
- [x] IBInspectable
or:
flatSwitch.setSelected(true, animated: true)
To listen to its state changes:
@IBAction func handleSwitchValueChange(sender: AnyObject) {
if let flatSwitch = sender as? AIFlatSwitch {
print(flatSwitch.isSelected)
}
}
Animation observer callbacks:
flatSwitch.selectionAnimationDidStart = { isSelected in
print("New state: \(isSelected)")
}
flatSwitch.selectionAnimationDidStop = { isSelected in
print("State when animation stopped: \(isSelected)")
}
Styling the switch:
flatSwitch.lineWidth = 2.0
flatSwitch.strokeColor = UIColor.blue
flatSwitch.trailStrokeColor = UIColor.red
flatSwitch.backgroundLayerColor = UIColor.red
flatSwitch.animatesOnTouch = false
- [x] IBInspectable
Contribution guidelines
- Make your changes in your branch
- Bump the pod version in AIFlatSwitch.podspec file (e.g. 1.0.1 to 1.0.2)
- Make sure the Example project compiles and works fine in the Simulator
- Find references to your source code changes in README.md and update them (e.g. method names, changed features)
- Create a pull request
License
AIFlatSwitch is released under the MIT license. See LICENSE for details.
animated check button, checkmark
*Note that all licence references and agreements mentioned in the AIFlatSwitch README section above
are relevant to that project's source code only.