Skip to content

nosboost/KNCirclePercentView

 
 

Repository files navigation

KNCirclePrecentView

A custom animated circle percent view

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Usage

  1. Add KNCirclePercentView using storyboard/nib/code
  2. 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;

Screenshot

iPhone

Installation

KNCirclePrecentView is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'KNCirclePrecentView'

License

KNCirclePrecentView is available under the MIT license. See the LICENSE file for more info.

About

Objective-C - A custom animated circle percent view

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Objective-C 68.1%
  • Shell 28.1%
  • Ruby 3.8%