测试测试 | ✗ |
语言语言 | SwiftSwift |
许可证 | MIT |
发布最后发布 | 2017年3月 |
SwiftSwift 版本 | 3.0.1 |
SPM支持 SPM | ✗ |
由 Kiran Jasvanee 维护。
通过曲线滑进进度!
要运行示例项目,请克隆仓库,然后首先从Example目录中运行pod install
。
KJCurveSlider可以通过代码或界面构建器使用。您可以在单个视图中添加两个或更多KJCurveSlider。
如果通过代码配置,请使用传统的初始化方法和属性。
如果使用Interface Builder,则要在您界面构建器中的UIView上添加UIView,然后添加KJCurveSlider到添加的UIView的'Class'身份检查器中的'Class'。
使用以下属性来编辑设计布局。在viewDidAppear
中添加您的布局设置。
// declare instance of KJCurveSlider by connecting to UIView outlet at interface builder
@IBOutlet weak var curveSliderLarge: KJCurveSlider!
// use showPrecision boolean property to allow or not a precisions in percentage value.
curveSliderLarge.showPrecision = true
// use sliderWidth property value to apply width in curve
curveSliderLarge.sliderWidth = 2.0
// use sliderColor property value to apply color in curve
curveSliderLarge.sliderColor = UIColor.black
// use sliderSelectedAreaWidth property value to apply width in selected curved area
curveSliderLarge.sliderSelectedAreaWidth = 10.0
// use sliderSelectedAreaWidth property value to apply color in selected curved area
curveSliderLarge.sliderSelectedAreaColor = UIColor.orange
// use sliderCapColor property value to apply cap color
curveSliderLarge.sliderCapColor = UIColor.green
// use sliderCapColor boolean property value to weather fill or not a cap with cap color
curveSliderLarge.sliderCapFillColor = true
// use KJCurveDelegate, a delegate property to receive processed percentage value by using it's protocol method.
curveSliderLarge.KJCurveDelegate = self
方法
// use this protocol method to receive slider values
func getPercentage(curveSliderInstance: KJCurveSlider, percentValue: Float) {
// use your declared instance for comparision, when you want use particular slider values at the time of two or more KJCurveSlider's available in single view.
// access of specific small slider values
if curveSliderInstance == curveSliderSmall {
labelPercentForSmallerCurveSlider.text = "\(percentValue)%"
}
}
Kiran Jasvanee,[email protected],Skype:KiranJasvanee
KJCurveSlider根据MIT许可证提供。有关更多信息,请参阅LICENSE文件。