An elegant and simple progress HUD for iOS and tvOS. Supports Swift and Objective-C!
The ultimate progress HUD for iOS and tvOS is here: JGProgressHUD!
UIMotionEffectfor a native look.
Download the source code and open the Examples project to try JGProgressHUD and see all of its features in action!
JGProgressHUD can also be used with SwiftUI. See JGProgressHUD-SwiftUI.
JGProgressHUD *HUD = [[JGProgressHUD alloc] init]; HUD.textLabel.text = @"Loading"; [HUD showInView:self.view]; [HUD dismissAfterDelay:3.0];
let hud = JGProgressHUD() hud.textLabel.text = "Loading" hud.show(in: self.view) hud.dismiss(afterDelay: 3.0)
This displays a dark HUD with an activity indicator and the title "Loading". The HUD is presented with a fade animation and is dismissed after 3 seconds with a fade animation.
JGProgressHUD *HUD = [[JGProgressHUD alloc] init]; HUD.textLabel.text = @"Error"; HUD.indicatorView = [[JGProgressHUDErrorIndicatorView alloc] init]; //JGProgressHUDSuccessIndicatorView is also available [HUD showInView:self.view]; [HUD dismissAfterDelay:3.0];
JGProgressHUD *HUD = [[JGProgressHUD alloc] init]; HUD.indicatorView = [[JGProgressHUDPieIndicatorView alloc] init]; //Or JGProgressHUDRingIndicatorView HUD.progress = 0.5f; [HUD showInView:self.view]; [HUD dismissAfterDelay:3.0];
For more examples, including in Swift, see Examples.
Important: You should always show
JGProgressHUD in a
JGProgressHUD can be displayed in 3 styles:
The style can also be set automatically according to the current
UITraitCollection (dark mode). Use the initializer
[[JGProgressHUD alloc] init]/
JGProgressHUD() to take advantage of the automatic style.
By default a HUD will display an indeterminate progress indicator. The indicator view can be completely hidden by setting the
indicatorView property to
nil. These indicator views are available by default:
Custom indicator views can be created by subclassing
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. These animations are available by default:
Custom animations can be created by subclassing
To dim the content behind the HUD set your dim color as
backgroundColor of your
In Xcode, use the menu File > Swift Packages > Add Package Dependency... and enter the package URL
This is the recommended way of installing JGProgressHUD.
JGProgressHUD.xcodeprojfile into your Xcode project.
JGProgressHUD.frameworkto "Embedded Binaries" in the "General" tab of your target.
After installing import the module where you want to use it:
See the Examples project for an example implementation of JGProgressHUD as framework.
JGProgressHUD can also be used by projects written in Swift. See Installation for details.
© 2014-2020, Jonas Gessner.
Created and maintained by Jonas Gessner, © 2014-2020.