jgp

JGProgressView

UIProgressView subclass with an animated "Indeterminate" setting (OS X Inspired)

Showing:

Popularity

Downloads/wk

0

GitHub Stars

52

Maintenance

Last Commit

7yrs ago

Contributors

4

Package

Dependencies

0

License

MIT

Categories

Readme

JGProgressView

© 2012-2014 Jonas Gessner


Setup

CocoaPods:
Add this to your Podfile:

pod 'JGProgressView', '1.2.1'

OR:

Add source Files:
1. Add the `JGProgressView` folder to your Xcode Project.
2. Add the **QuartzCore** framework to your project.
3. `#import "JGProgressView.h"`.

Basic Usage

JGProgressView is used like a normal UIProgressView with the addition of a few properties:

BOOL indeterminate

Property for the indeterminate setting, default is NO, set to YES to start the indeterminate animation.

UIImage *animationImage

Use this property to set a custom image to use for the indeterminate animation. Set this to nil to use the standard image for the current UIProgressViewStyle.

NSTimeInterval animationSpeed

Adjust the speed of the animation. The higher the value is, the slower the animation becomes. The default value is 0.5, negative values will invert the animation direction.

beginUpdates

endUpdates

Use begin- and endUpdates to increase performance when changing multiple properties of JGProgressView.



BOOL useSharedProperties

Defaults to NO. Set to YES to use shared image, animation speed and progress view style. This may help increasing performance when using many progress views with the same properties (ex. in a UITableViewCell).


If `useSharedImages` is `YES`. Setting `animationImage` and `animationSpeed` or calling `beginUpdate`and `endUpdates`has no effects. Instead use the following methods to change the visuals of all JGProgressViews that have `useSharedProperties` set to `YES`.
+ (void)setSharedProgressViewAnimationSpeed:(NSTimeInterval)speed;
+ (void)setSharedProgressViewImage:(UIImage *)img;
+ (void)setSharedProgressViewStyle:(UIProgressViewStyle)style;

+ (void)beginUpdatingSharedProgressViews;
+ (void)endUpdatingSharedProgressViews;

Demo

    JGProgressView *progressView = [[JGProgressView alloc] init];
    
    progressView.frame = CGRectMake(100.0f, 100.0f, 200.0f, progressView.frame.size.height);
    progressView.animationSpeed = 1.5;
    
    [self.view addSubview:progressView];

    progressView.indeterminate = YES;

Important note if your project doesn't use ARC: you must add the -fobjc-arc compiler flag to JGProgressView.m in Target Settings > Build Phases > Compile Sources.

Credits

Created by Jonas Gessner. ©2012-2014

License

JGProgressView is available under the MIT License.

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100