OOSwitch
Example
To run the example project, clone the repo, and run pod install
from the Example directory first.
or
var customSwitch: OOSwitch = {
let customSwitch = OOSwitch()
customSwitch.translatesAutoresizingMaskIntoConstraints = false
customSwitch.onTintColor = UIColor.orange
customSwitch.offTintColor = UIColor.darkGray
customSwitch.imageCornerRadius = 0.5
customSwitch.thumbCornerRadius = 0.5
customSwitch.thumbTintColor = UIColor.white
customSwitch.animationDuration = 0.25
customSwitch.onImage = #imageLiteral(resourceName: "component-71-1")
customSwitch.offImage = #imageLiteral(resourceName: "qatar")
customSwitch.labelOn.text = "Roaming"
customSwitch.labelOff.text = "Local"
customSwitch.areLabelsShown = true
return customSwitch
}()
Requirements
- iOS 10.0+
- Xcode 11+
Installation
OOSwitch is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'OOSwitch'
Author
Hassan Gado, hgado11@gmail.com
License
OOSwitch is available under the MIT license. See the LICENSE file for more info.