KJCurveSlider 0.1.0

KJCurveSlider 0.1.0

测试测试
语言语言 SwiftSwift
许可证 MIT
发布最后发布2017年3月
SwiftSwift 版本3.0.1
SPM支持 SPM

Kiran Jasvanee 维护。



  • Kiran Jasvanee

预览

通过曲线滑进进度!

KJCurveSlider

示例

要运行示例项目,请克隆仓库,然后首先从Example目录中运行pod install

要求

  • Swift 3.0.1 或更高版本
  • iOS 10.1 或更高版本

用法

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文件。