This is a simple and adaptive Circular Progress View.
It basically consists of two CAShapeLayers to draw a static and a animated circle, and a progress label with two lines, the first to describe a timer and the second for a state.
- automatically update the circle progress when the elapsed time is set
- autolayout compatible
- autoformat the timer label
- tint color of progress layer and label
- state description can be changed
Grab the files in View/CircularProgressView
and put it in your
project. The code uses ARC, so make sure to turn that on for the files if you're
not already using ARC.
Subclass CircularProgressView or manually create a new instance using alloc/initWithFrame:
CircleProgressView *progressView = [[CircleProgressView alloc] initWithFrame:CGRectMake(0, 0, 200, 200)];
Configure the parameters before set the elapsed time:
[_circleProgressView setTimeLimit:3600*8];
[_circleProgressView setStatus:NSLocalizedString(@"circle-progress-view.status-not-started", nil)];
[_circleProgressView setTintColor:[UIColor whiteColor]];
[_circleProgressView setElapsedTime:0];
CircularProgressView
is released under the MIT license.
Carlos Arantes (@carantes)