• Stars
    star
    3,285
  • Rank 13,668 (Top 0.3 %)
  • Language
    Objective-C
  • License
    MIT License
  • Created over 10 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

An elegant and simple progress HUD for iOS and tvOS, compatible with Swift and ObjC.

JGProgressHUD

An elegant and simple progress HUD for iOS and tvOS. Supports Swift and Objective-C!

Overview

The ultimate progress HUD for iOS and tvOS is here: JGProgressHUD!

  • Plug and play: Simple integration, easy to use, few lines of code required.
  • Easily customizable (custom animations, indicator views and more).
  • Uses UIVisualEffectView and UIMotionEffect for a native look.
  • Uses AutoLayout to provide a fully dynamic layout.
  • Detects and repositions when keyboard appears/disappears.
  • Dark mode support β€” automatically changes appearance.
  • Well documented and maintained.
  • Voice Over/UIAccessibility support.
  • Backward compatibility to iOS 8.
  • Can be used with Swift and Objective-C.
  • And most importantly, it looks good!

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.

GitHub license CocoaPods Carthage compatible Carthage compatible

Examples

Β  Β  Β  Β  Β  Β 

Showing indeterminate progress:

Objective-C:

JGProgressHUD *HUD = [[JGProgressHUD alloc] init];
HUD.textLabel.text = @"Loading";
[HUD showInView:self.view];
[HUD dismissAfterDelay:3.0];

Swift:

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.

Showing an error message:

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];

Showing determinate progress:

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 UIViewController view.

Customization

Styles:

JGProgressHUD can be displayed in 3 styles:

  • Extra Light
  • Light
  • Dark

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.

Indicator Views:

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:

  • Indeterminate progress indicator
  • Pie progress indicator
  • Ring progress indicator
  • Success indicator
  • Error indicator
  • Image indicator

Custom indicator views can be created by subclassing JGProgressHUDIndicatorView.

Animations:

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:

  • Fade
  • Zoom and Fade

Custom animations can be created by subclassing JGProgressHUDAnimation.

To dim the content behind the HUD set your dim color as backgroundColor of your JGProgressHUD instance.

Installation

Swift Package Manager:

In Xcode, use the menu File > Swift Packages > Add Package Dependency... and enter the package URL https://github.com/JonasGessner/JGProgressHUD.git.

This is the recommended way of installing JGProgressHUD.

Carthage:

In your Cartfile add:

github "JonasGessner/JGProgressHUD"

CocoaPods:

In your Podfile add:

pod 'JGProgressHUD'

Manual Installation:

  1. Drag the JGProgressHUD.xcodeproj file into your Xcode project.
  2. Add JGProgressHUD.framework to "Embedded Binaries" in the "General" tab of your target.

After installing import the module where you want to use it:

@import JGProgressHUD;

Swift:

import JGProgressHUD

See the Examples project for an example implementation of JGProgressHUD as framework.

Requirements

  • Base SDK of iOS/tvOS/macCatalyst 13.0 or higher.
  • Deployment target of iOS 8.0, tvOS 9.0, macCatalyst 13.0, or higher.

JGProgressHUD can also be used by projects written in Swift. See Installation for details.

Documentation

Detailed documentation can be found on here.

Each class and method is well documented, making it easy to quickly get a good overview. To start, see JGProgressHUD.h.

License

MIT License.
Β© 2014-2020, Jonas Gessner.

Credits

Created and maintained by Jonas Gessner, Β© 2014-2020.

More Repositories

1

JGActionSheet

Feature-rich action sheet for iOS. This ActionSheet is a replacement for UIActionSheet, with iPad support!
Objective-C
855
star
2

JGScrollableTableViewCell

A simple UITableViewCell subclass with a scrollable content view, exposing an accessory view when scrolled. Inspired by the iOS 7 mail app. Supports iOS 5+
Objective-C
196
star
3

JGDownloadAcceleration

Download acceleration for iOS. Based on NSURLConnection and NSOperation.
Objective-C
140
star
4

JGMethodSwizzler

Powerful and easy to use Objective-C swizzling API.
Objective-C
125
star
5

JGProgressHUD-SwiftUI

Easily show HUDs with SwiftUI! Lightweight SwiftUI wrapper for JGProgressHUD for iOS, tvOS, Catalyst.
Swift
99
star
6

JGProgressView

UIProgressView subclass with an animated "Indeterminate" setting (OS X Inspired)
Objective-C
52
star
7

ImageReducer

Drag & drop image reducer. Creates 2x and 1x images out of 3x images on the fly.
Objective-C
42
star
8

CCLoader

Developer utility for loading custom plugins into Control Center on iOS 7 and higher.
Objective-C
38
star
9

JGDetailScrubber

UISlider subclass with variable scrubbing speeds. Inspired by the iOS Music app.
Objective-C
35
star
10

Theos-NIC-Templates

Modern templates for NIC.
C
35
star
11

BrightnessFix

Restore Brightness after killing SpringBoard on iOS 6
Logos
8
star
12

Share-Widget-for-Control-Center

An example widget for Control Center. To be used with CCLoader
Objective-C
5
star
13

Theos-Install-Scripts

Useful scripts for theos projects to install packages via USB rather than SSH.
Python
5
star
14

Open-in-ProTube-2

Opens YouTube links directly in ProTube
Objective-C
4
star
15

SCION-WebRTC

Video Calls over SCION with advanced path control
Swift
4
star
16

SevenCenter

iOS 7 style NotificationCenter for iOS 5 & iOS 6
Logos
4
star
17

ETH-Algolab-2019

Solutions for the ETH Algorithms Lab problems for HS 2019
C++
3
star
18

BridgeConnect

Library for importing media using Bridge.
Objective-C
2
star
19

NoCarrier

Remove the carrier logo from the status bar on iOS.
C
2
star
20

Open-in-ProTube

Opens youtube URLs in ProTube app instead of YouTube app.
Objective-C
2
star
21

WebRTC

WebRTC builds for iOS and macOS that actually (hopefully) work...
C++
1
star
22

ascii85

macOS command line tool for ascii85 encoding and decoding
Swift
1
star
23

Flipswitch-Toggles

Additional switches for Flipswitch
C
1
star