TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | Oct 2015 |
Maintained by Thomas Winkler.
A custom UIView with a rounded progress bar and a counter in the center of the circle. Supports multiple time intervals (in milliseconds), start/stop/resuming counter, set custom color, etc. (see example project)
Installing with CocoaPods
If you're unfamiliar with CocoaPods you can check out this tutorial here.
Add the pod SFRoundProgressCounterView
to your Podfile.
platform :ios, '7.0'
pod 'SFRoundProgressCounterView'
Run pod install
.
.xcworkspace
file to launch Xcode and start using the control!Set up time intervals
self.sfProgressCounterView.delegate = self;
NSNumber* interval = [NSNumber numberWithLong:5000.0];
self.sfProgressCounterView.intervals = @[interval];
// you could also define multiple intervals
//self.sfProgressCounterView.intervals = @[interval, interval, interval];
Counter interaction
[self.sfProgressCounterView start];
[self.sfProgressCounterView stop];
[self.sfProgressCounterView resume];
[self.sfProgressCounterView reset];
Appearance Settings
// thickness of outer circle
self.sfProgressCounterView.outerCircleThickness = [NSNumber numberWithFloat:3.0];
// thickness of inner circle
self.sfProgressCounterView.innerCircleThickness = [NSNumber numberWithFloat:1.0];
// track color of outer circle
self.sfProgressCounterView.innerTrackColor = [UIColor redColor];
// track color of inner circle
self.sfProgressCounterView.outerTrackColor = [UIColor blackColor];
// distance between two circles (if multiple intervals)
self.sfProgressCounterView.circleDistance = [NSNumber numberWithFloat:6.0];
// set color of outer progress circles
self.sfProgressCounterView.outerProgressColor = color;
// set color of inner progress circle
self.sfProgressCounterView.innerProgressColor = color;
// set color of counter label
self.sfProgressCounterView.labelColor = color;
// hide fraction
self.sfProgressCounterView.hideFraction = YES;
- (void)countdownDidEnd:(SFRoundProgressCounterView*)progressCounterView;
- (void)intervalDidEnd:(SFRoundProgressCounterView*)progressCounterView WithIntervalPosition:(int)position;
- (void)counter:(SFRoundProgressCounterView *)progressCounterView didReachValue:(unsigned long long)value;
Distributed under the MIT License.