ZProgressCircle is a simple, out of the box Swift component that represents a circle that fills up
ZProgressCircle is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'ZProgressCircle'
-
Drag a UIView in your storyboard
-
The progress circle should now appear on your storyboard as follows
-
You can now customise it through the @IBInspectable variables available :
The available customisations are the following :
- Total count : the total amount required to fill the circle
- Completion count : the actual amount
- Percent complete : a percentage of completion (same as completion count but in percentage)
- Completion color : the color of the circle when completed
- Original color : the color of the circle when at 0
- Filling color : the collor of the filling part of the circle
You also have access to isCompleted
boolean attribute to check if the circle is completed or not
Availables methods :
- increment() : add step to the circle
- setCompletion(to value: Int) : set the circle to the desired value. If the value is > the total count required then the circle is set to completed
To run the example project, clone the repo, and run pod install
from the Example directory first.
Zlatan, [email protected]
ZProgressCircle is available under the MIT license. See the LICENSE file for more info.