- Clone the repo and drag the Classes folder into your project. This should include VAProgressCircle.h/.m, and UIProgressLabel.h/.m
- Either create a VAProgressCircle using the
- (id)initWithFrame:(CGRect)frame
method or drag and drop a UIView into your Interface Builder, subclass it to VAProgressCircle, and link it up to a property in your UIViewController
Here is the snippet of code slightly modified from the example app included in the repo. This shows how to initalize and add a VAProgressChart to your UIViewController using - (id)initWithFrame:(CGRect)frame
self.circleChart = [[VAProgressCircle alloc] initWithFrame:CGRectMake(50, 60, 250, 250)];
[self.view addSubview:self.circleChart];
- VAProgressChart only supports opaque colors at the current release. Using any non-opaque colors could cause unwanted behavior
The bread and butter method. Takes the current state of the VAProgressCircle and updates the circle to the progress that was passed
Sets the color for all the relevant properties of the circle. This includes circleColor, accentLineColor, and numberLabelColor. Also sets the circleHighlightColor by taking the (UIColor *)color
and making it 20% lighter
Sets the transition color for all the relevant properties of the circle. This includes circleTransitionColor, accentLineTransitionColor, and numberLabelTransitionColor. Also sets the circleHighlightTransitionColor by taking the (UIColor *)transitionColor
and making it 20% lighter
Functions similar to - (void)setColor:(UIColor *)color
but allows the specification of a highlightColor
Functions similar to - (void)setTransitionColor:(UIColor *)transitionColor
but allows the specification of a highlightColor
Should be set to VAProgressCircleColorTransitionTypeGradual
if you want the spinner to transition to a second color as it approaches 100%. Defaults to VAProgressCircleColorTransitionTypeNone
Designates which way the progress will rotate around the VAProgressChart. Defaults to VAProgressCircleRotationDirectionCounterClockwise
Designates how fast the animation should animate. Defaults to 1.0f
Designates whether or not an accent line should be allocated and animated every time a progress piece reaches the outer circle. Defaults to YES
Designates whether or not the VAProgressCircle will create a full accent circle when it reaches 100%. Defaults to YES
Designates whether or not a progress piece will highlight when it reaches the outer circle. Defaults to YES
If transitionType is set to VAProgressCircleColorTransitionTypeGradual
, shouldNumberLabelTransition specifies if the number label should change color along with the rest of the VAProgressCircle. Defaults to YES
Designates what color the outer circle should be. Defaults to VADefaultGreen
Designates what color line the VAProgressCircle generates as a progress piece reaches the outer circle. Defaults to VADefaultGreen
Designates the color of the number label. Defaults to VADefaultGreen
Designates the highlight color of the progress pieces if shouldHighlightProgress
is set to YES
. Defaults to VADefaultGreen
Designates what color the outer circle should transition to as it approaches 100%. Defaults to VADefaultBlue
Designates what color line the VAProgressCircle generates should transition to as it approaches 100%. Defaults to VADefaultBlue
Designates the color of the number label should transition to as it approaches 100%. Defaults to VADefaultBlue
Designates the transition highlight color of the progress pieces as the VAProgressCircle approaches 100% if shouldHighlightProgress
is set to YES
. Defaults to VADefaultBlue
VAProgressCircle is available under the MIT license. See the LICENSE file for more info.