Git Product home page Git Product logo

jgprogressview's Introduction

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.

jgprogressview's People

Contributors

jonasgessner avatar

Stargazers

Shekhar Gupta avatar

Watchers

James Cloos avatar Shekhar Gupta avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.