Swift厚度选择器
一个简单的iOS厚度选择器。
支持两种模式:垂直和水平。
安装
CocoaPods
pod 'SwiftThicknessPicker'
手动
Copy SwiftThicknessPicker.swift to your project.
使用
你可以从Storyboard或XIB中创建它。或者手动创建
let picker = SwiftThicknessPicker()
为了处理值的改变,你应该实现协议SwiftThicknessPickerDelegate
picker.delegate = self func valueChanged(value: Int) }
方向
picker.direction = SwiftThicknessPicker.PickerDirection.Vertical // Vertical, Horizontal
你还可以更改当前值、最大值或最小值,例如
picker.currentValue = 0 picker.maxValue = 30 picker.minValue = 1
和其他设置
labelFontColor // Font color of the moving label labelBackgroundColor // Background color of the moving label labelFont // Font of the moving label
许可证
Swift厚度选择器在MIT许可证下可用。有关更多信息,请参阅LICENSE文件。