KYCircularProgress
Flexible progress bar written in Swift.
用Swift语言编写的灵活的进度条控件。
- Gradation Color 渐变的颜色
- Progress Closure 进度渐变
- UIBezierPath Progress Bar 支持贝塞尔曲线
- iOS7.0+
- Xcode6.0.1+
Create KYCircularProgress 创建KYCircularProgress
var circularProgress: KYCircularProgress! = KYCircularProgress(frame: self.view.bounds)
// support Hex color to RGB color
circularProgress.colors = [0xA6E39D, 0xAEC1E3, 0xE1A5CB, 0xF3C0AB]
circularProgress.progressChangedClosure({ (progress: Double, circularView: KYCircularProgress) in
println("progress: (progress)")
})
UIBezierPath Progress Bar 贝塞尔曲线的bar
// create "Star progress bar"
let path = UIBezierPath()
path.moveToPoint(CGPointMake(50.0, 2.0))
path.addLineToPoint(CGPointMake(84.0, 86.0))
path.addLineToPoint(CGPointMake(6.0, 33.0))
path.addLineToPoint(CGPointMake(96.0, 33.0))
path.addLineToPoint(CGPointMake(17.0, 86.0))
path.closePath()
circularProgress.path = path
- Add
KYCircularProgress.swift
in your project. 将KYCircularProgress.swift添加到你的项目当中即可