CocoaPods trunk is moving to be read-only. Read more on the blog, there are 19 months to go.
TestsTested | ✗ |
LangLanguage | SwiftSwift |
License | BSD |
ReleasedLast Release | Dec 2016 |
SwiftSwift Version | 3.0 |
SPMSupports SPM | ✗ |
Maintained by Marco Ramos.
Depends on: | |
SDWebImage | >= 0 |
JGProgressHUD | >= 0 |
Modern and extensive Apple-style progress HUD for iOS.
The ultimate progress HUD for iOS has arrived: JGProgressHUD!
• Well designed, easy to use.
• Feature-rich.
• Extensible and customizable (custom animations, indicator views and more).
• Uses the newest features of iOS: Blurred HUD (iOS 8+), parallax effect (iOS 7+).
• Backward compatibility to iOS 6.
• Well documented and maintained.
• Detects and repositions when keyboard appears/disappears.
• Voice Over/UIAccessibility
support.
• And most importantly, it looks good!
The Examples project contains all kinds of different uses of JGProgressHUD. Check out the code and see what JGProgressHUD can do!
JGProgressHUD can be displayed in 3 styles:
• Extra Light
• Light
• Dark
By default a HUD will display an indeterminate progress indicator. You can not show an indicator view at all by setting the indicatorView
property to nil. These indicator views are available:
• Indeterminate progress indicator
• Pie progress indicator
• Ring progress indicator
• Success indicator
• Error indicator
• Image indicator
By subclassing JGProgressHUDIndicatorView
you can create a custom indicator view!
By default a HUD will use a fade animation. Several parameters can be altered such as animation duration or animation curve. A HUD can be displayed without animation and different animations can be used. By default there are the following animations built in:
• Fade
• Zoom and Fade
By subclassing JGProgressHUDAnimation
you can create a custom animation!
To dim the content behind the HUD set your dim color as backgroundColor
of your JGProgressHUD
instance.
• Base SDK of iOS 8 or higher.
• Deployment target of iOS 6.0 or higher.
• ARC.
• JGProgressHUD can also be used by projects written in Swift. See Installation for details.
Detailed documentation can be found on CocoaDocs.
Each method is well documented, making it easy to quickly get a great overview of JGProgressHUD. To start, see JGProgressHUD.h.
JGProgressHUD *HUD = [JGProgressHUD progressHUDWithStyle:JGProgressHUDStyleDark];
HUD.textLabel.text = @"Loading";
[HUD showInView:self.view];
[HUD dismissAfterDelay:3.0];
This displays a dark HUD with a spinner and the title “Loading”, it is presented with a fade animation and is dismissed after 3 seconds with a fade animation.
JGProgressHUD *HUD = [JGProgressHUD progressHUDWithStyle:JGProgressHUDStyleDark];
HUD.textLabel.text = @"Error";
HUD.indicatorView = [[JGProgressHUDErrorIndicatorView alloc] init]; //JGProgressHUDSuccessIndicatorView is also available
[HUD showInView:self.view];
[HUD dismissAfterDelay:3.0];
JGProgressHUD *HUD = [JGProgressHUD progressHUDWithStyle:JGProgressHUDStyleDark];
HUD.indicatorView = [[JGProgressHUDImageIndicatorView alloc] initWithImage:[UIImage imageNamed:@"my_image.png"]];
[HUD showInView:self.view];
[HUD dismissAfterDelay:3.0];
JGProgressHUD *HUD = [JGProgressHUD progressHUDWithStyle:JGProgressHUDStyleDark];
HUD.indicatorView = [[JGProgressHUDPieIndicatorView alloc] initWithHUDStyle:HUD.style]; //Or JGProgressHUDRingIndicatorView
[HUD showInView:self.view];
[HUD dismissAfterDelay:3.0];
Important: You should always show HUDs in a UIViewController’s view.
See the Examples project for more example implementations.
CocoaPods:
Add this to your Podfile
:
pod 'JGProgressHUD'
OR:
Framework (iOS >= 8.0 only):
1. Drag the JGProgressHUD.xcodeproj
file into your Xcode project.
2. Add JGProgressHUD.framework
to “Embedded Binaries” in the “General” tab of your project’s target.
3. Add the -ObjC
flag to “Other Linker Flags” in the “Build Settings” tab of your project’s target.
See the Examples project for an example implementation of JGProgressHUD as framework.
After you have included JGProgressHUD as framework simply import JGProgressHUD.h
like this:
#import <JGProgressHUD/JGProgressHUD.h>
Swift projects:
import JGProgressHUD
OR:
Static Library:
1. Drag the JGProgressHUD.xcodeproj
file into your Xcode project.
2. Add JGProgressHUD
and JGProgressHUD Resources
to “Target Dependencies” in the “Build Phases” tab of your project’s target.
3. Add libJGProgressHUD.a
to “Link Binary With Libraries”.
4. From the JGProgressHUD.xcodeproj
’s “Products” Directory drag the JGProgressHUD Resources.bundle
into the “Copy Bundle Resources” section.
5. Add the -ObjC
flag to “Other Linker Flags” in the “Build Settings” tab of your project’s target.
See the Examples project for an example implementation of JGProgressHUD as static library.
After you have included JGProgressHUD as static library simply import JGProgressHUD.h
like this:
#import "JGProgressHUD.h"
Swift projects need to import JGProgressHUD in the Objective-C bridging header.
An example of JGProgressHUD in a RubyMotion project can be found here.
MIT License.
© 2014-2016, Jonas Gessner.
Created and maintained by Jonas Gessner, © 2014-2016.