Circular progress view written in Swift because these controls always come in handy.
- Add CCGCircularProgressView instance to your view (OR, in Interface Builder, set an UIView's Custom Class to CCGCircularProgressView).
- roundedCorner
- radius
- startAngle
- lineColor
- lineWidth
- trackColor
- trackWidth
class ViewController: UIViewController {
@IBOutlet weak var progressView : CCCircularProgressView! {
didSet {
progressView.isBarRounded = true
progressView.radius = 140
progressView.startAngle = -CGFloat.pi/2
progressView.lineColor = .red
progressView.lineWidth = 20
progressView.trackColor = .lightGray
progressView.trackWidth = 25
}
}
.
.
}
// Progress value is between 0 and 1
progressView.progress = 0.5
To run the example project, clone the repo, and run pod install
from the Example directory first.
CCCircularProgressView-Swift is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'CCCircularProgressView-Swift'
Hsuan-Chih Chuang, hsuanchih.chuang@gmail.com
CCCircularProgressView-Swift is available under the MIT license. See the LICENSE file for more info.