MBCircularProgressBar 0.3.5

MBCircularProgressBar 0.3.5

TestsTested
LangLanguage Obj-CObjective C
License MIT
ReleasedLast Release Nov 2016

Maintained by Mati Bot.




If you use MBCircularProgressBar, please tell me and I will add your app here.

Usage

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

Installation

Directly

You can also download the MBCircularProgressBar{View,Layer}.{m,h} files into your project directly

Properties

Property name Property type Description Range
value CGFloat The value to be displayed in the center [0,maxValue]
maxValue CGFloat The maximum possible value, used to calculate the progress (value/maxValue) [0,∞)
showValueString BOOL Should show value string
showUnitString BOOL Should show unit string
valueFontName NSString The name of the font of the value string Any valid font name
valueFontSize CGFloat The font size of the value text [0,∞)
valueFontName NSString The name of the font of the unit string Any valid font name
unitFontSize CGFloat The font size of the unit text [0,∞)
unitString NSString The string that represents the units, usually %
fontColor UIColor The color of the value and unit text
decimalPlaces NSInteger Number of decimal places of the value [0,∞)
progressRotationAngle CGFloat Progress bar rotation (Clockewise) [0,100]
progressAngle CGFloat Set a partial angle for the progress bar [0,100]
progressLineWidth CGFloat The width of the progress bar (user space units) [0,∞)
progressColor UIColor The color of the progress bar
progressStrokeColor UIColor The color of the progress bar frame
progressCapType NSInteger The shape of the progress bar cap {kCGLineCapButt=0, kCGLineCapRound=1, kCGLineCapSquare=2}
emptyLineWidth CGFloat The width of the background bar (user space units) [0,∞)
emptyLineColor CGFloat The color of the background bar
emptyCapType CGFloat The shape of the background bar cap {kCGLineCapButt=0, kCGLineCapRound=1, kCGLineCapSquare=2}
textOffset CGPoint The offset to apply to the unit / value text (0,0) = center of the circle

Animation

In order to animate a change in the progress bar you should nest the value property manipulation in a [UIView animateWithDuration:] method

    [UIView animateWithDuration:1.f animations:^{
        self.progressBar.value = 55.f;
    }];

References

[iOS][Swift] MBCircularProgressBar で円形のプログレスバーを実現 by @cocominap (in Japanese)

Author

Mati Bot, [email protected], @b0tnik

Apps that use it:

20 Hours

License

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