Features
- Interface builder designable
- Highly customizable and flexible
- Easy to use
- Sleek animations
- Written in Swift
- RTL language support
Apps Usig UICircularProgressRing
-
GradePoint by Luis Padron.
-
UVI Mate by Alexander Ershov.
-
HotelTonight by Hotel Tonight Inc.
-
הנתיב המהיר by Elad Hayun
Usage
Interface Builder
Simply drag a UIView
into your storyboard. Make sure to subclass UICircularProgressRingView
and that the module points UICircularProgressRing
.
Design your heart out
Code
override func viewDidLoad() {
// Create the view
let progressRing = UICircularProgressRingView(frame: CGRect(x: 0, y: 0, width: 240, height: 240))
// Change any of the properties you'd like
progressRing.maxValue = 50
progressRing.innerRingColor = UIColor.blue
// etc ...
}
To set a value and animate the view
// Somewhere not in viewDidLoad (since the views have not set yet, thus cannot be animated)
// Remember to use unowned or weak self if refrencing self to avoid retain cycle
progressRing.setProgress(value: 49, animationDuration: 2.0) {
print("Done animating!")
// Do anything your heart desires...
}
Example project
Take a look at the example project over here
- Download it
- Open the
Example.xcworkspace
in Xcode - Mess around and experiment!