KYCircularProgress
Flexible progress bar written in Swift.
Features
- Gradation Color
- UIBezierPath Progress Bar
- Progress Closure
Demo
Requirement
- iOS7.0+
- Xcode6.0.1 (Swift 1.0)
Usage
Create KYCircularProgress
var circularProgress: KYCircularProgress! = KYCircularProgress(frame: self.view.bounds)
Gradation Progress Bar
// support Hex color to RGB color
circularProgress.colors = [circularProgress.colorHex(0xA6E39D).CGColor!, circularProgress.colorHex(0xAEC1E3).CGColor!, circularProgress.colorHex(0xE1A5CB).CGColor!, circularProgress.colorHex(0xF3C0AB).CGColor!]
Progress Closure
circularProgress.progressChangedBlock({ (progress: Double, circular: KYCircularProgress) in
println("progress: \(progress)")
})
UIBezierPath Progress 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
Installation
- Add
KYCircularProgress.swift
in your project.
Licence
MIT