KYCircularProgress
Flexible progress bar written in Swift.
Features
- Gradation Color
- Progress Closure
- UIBezierPath Progress Bar
- Progress Gauge Guide
ToDo
- Customizable on Storyboard
- Installation via CocoaPods
- Progress Change Animation
Demo
Requirement
- iOS7.0+
- Xcode6.3+
Usage
Create KYCircularProgress
// create KYCircularProgress
var circularProgress: KYCircularProgress! = KYCircularProgress(frame: self.view.bounds)
// create KYCircularProgress with gauge guide
var circularProgress: KYCircularProgress! = KYCircularProgress(frame: self.view.bounds, showProgressGuide: true)
Gradation Color
// support Hex color to RGBA color
circularProgress.colors = [UIColor(rgba: 0xA6E39D11), UIColor(rgba: 0xAEC1E355), UIColor(rgba: 0xAEC1E3AA), UIColor(rgba: 0xF3C0ABFF)]
// combine Hex color and UIColor
circularProgress.colors = [UIColor.purpleColor(), UIColor(rgba: 0xFFF77A55), UIColor.orangeColor()]
Progress Closure
circularProgress.progressChangedClosure({ (progress: Double, circularView: 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
The MIT License (MIT)
Copyright (c) 2014 Kengo YOKOYAMA