A custom animated circle percent view
To run the example project, clone the repo, and run pod install
from the Example directory first.
- Add KNCirclePercentView using storyboard/nib/code
- Call Methods:
/*
* Draw Circle with specified radius
*
* @param percent percent of circle to display
* @param duration animation duration
* @param lineWidth witdth of circle
* @param clockwise determine clockwise
* @param lineCap line cap - kCALineCapButt, kCALineCapRound, kCALineCapSquare
* @param fillColor color inside circle
* @param strokeColor color of circle line
* @param backgroundStrokeColor color of the stroke background
* @param animatedColors colors array to animated. if this param is nil, stroke color will be used to draw circle
*/
- (void)drawCircleWithPercent:(CGFloat)percent
duration:(CGFloat)duration
lineWidth:(CGFloat)lineWidth
clockwise:(BOOL)clockwise
lineCap:(NSString *)lineCap
fillColor:(UIColor *)fillColor
strokeColor:(UIColor *)strokeColor
backgroundStrokeColor:(UIColor *)backgroundStrokeColor
animatedColors:(NSArray *)colors;
- (void)startAnimation;
KNCirclePrecentView is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'KNCirclePrecentView'
KNCirclePrecentView is available under the MIT license. See the LICENSE file for more info.