OOSwitch
示例
要运行示例项目,请克隆仓库,然后首先从 Example 目录中运行 pod install
。或者
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
}()
要求
- iOS 10.0+
- Xcode 11+
安装
OOSwitch 通过 CocoaPods 提供。要安装它,只需将以下行添加到您的 Podfile 中
pod 'OOSwitch'
作者
Hassan Gado, [email protected]
许可协议
OOSwitch可在MIT许可下使用。有关更多信息,请参阅LICENSE文件。