Latest 0.1.1
Homepage https://github.com/tiagomnh/THCircularProgressView
License MIT
Platforms ios 5.0, requires ARC
Authors

THCircularProgressView is a UIView subclass with a circular bar useful for illustrating progress.

Screenshot

Installation

Drag the contents of THCircularProgressView/ into your project.

Usage

THCircularProgressView is simply a UIView subclass so just instantiate it and add it a view hieararchy. The initializer is:

- (instancetype)initWithCenter:(CGPoint)center
              radius:(CGFloat)radius
           lineWidth:(CGFloat)lineWidth
        progressMode:(THProgressMode)progressMode
       progressColor:(UIColor *)progressColor
progressBackgroundMode:(THProgressBackgroundMode)backgroundMode
progressBackgroundColor:(UIColor *)progressBackgroundColor
          percentage:(CGFloat)percentage

You can also use the standard -[UIView initWithFrame:(CGRect)frame].

It supports two kinds of progress mode:

  • THProgressModeFill – starts empty and gets filled as percentage increases; (default)
  • THProgressModeDeplete – starts full and depletes as percentage increases;

There is also a label that can be set to display the number the progress view represents. For example:

THCircularProgressView *progress = ...;
CGFloat percentage = 0.3f;
progress.centerLabel.text = [NSString stringWithFormat:@"%.0f", percentage * 100.0f];
progress.centerLabelVisible = YES; // needed since label is invisible by default

The sample project in /Demo contains some examples.

License

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

Latest podspec

{
    "name": "THCircularProgressView",
    "version": "0.1.1",
    "summary": "A configurable circular progress view.",
    "homepage": "https://github.com/tiagomnh/THCircularProgressView",
    "screenshots": "https://raw.github.com/tiagomnh/THCircularProgressView/master/Screenshot.png",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Tiago Henriques": "[email protected]"
    },
    "source": {
        "git": "https://github.com/tiagomnh/THCircularProgressView.git",
        "tag": "0.1.1"
    },
    "platforms": {
        "ios": "5.0"
    },
    "source_files": "THCircularProgressView/*.{h,m}",
    "requires_arc": true
}

Pin It on Pinterest

Share This