IOS HUD Swift Library

Overview

JHProgressHUD

JHProgressHUD is an iOS class written in Swift to display a translucent HUD with an indicator and/or labels while work is being done in a background thread. The HUD is meant as a replacement for the private UIKit UIProgressHUD.

Screenshots

Adding JHProgressHUD to your project

Source Files

Add the JHProgressHUD.swift file to your project.

  1. Download the latest code version or add the repository as a git submodule to your git-tracked project.
  2. Open your project in Xcode, then drag and drop JHProgressHUD.swift onto your project (use the "Product Navigator view"). Make sure to select Copy items when asked if you extracted the code archive outside of your project.

Usage

The JHProgressHUD is a singleton class and has only a single instance throughout the project. That is you see the same HUD added to multiple views. As a result, HUD duplication doesn't happen. You can use the following code to access the instance of JHProgressHUD anywhere inside the project.

JHProgressHUD.sharedHUD

To show the HUD added to a view, with a title and footer text, use the following code:

JHProgressHUD.sharedHUD.showInView(self.view, withHeader: "Loading", andFooter: "Please Wait")

To show the HUD added to a window, with a title and footer text, use the following code:

JHProgressHUD.sharedHUD.showInWindow(aWindow, withHeader: "Loading", andFooter: "Please Wait")

To show the HUD without any header and footer text added to a view:

JHProgressHUD.sharedHUD.showInView(self.view)

To show the HUD without any header and footer text added to a window:

JHProgressHUD.sharedHUD.showInWindow(aWindow)

To hide the loader, you can call the following function from any class. The HUD will be removed from any view it is shown in:

JHProgressHUD.sharedHUD.hide()

You can also change the colors of different elements of the HUD using the following four properties:

JHProgressHUD.sharedHUD.headerColor = UIColor.redColor() // Changes the color of the title text
JHProgressHUD.sharedHUD.footerColor = UIColor.greenColor() // Changes the color  of the footer text
JHProgressHUD.sharedHUD.backGroundColor = UIColor.blueColor() // Changes the color of the translucent background
JHProgressHUD.sharedHUD.loaderColor = UIColor.yellowColor() // Changes the color of the loading indicator

The HUD might not show if you try to display the loader in a ViewController's viewDidLoad() method, since adding subviews maynot always work in the viewDidLoad(). It is prefered to show the HUD at least only after the viewWillAppear() is called. The HUD blocks the user interaction in the underlying view or window once it is shown, till it is hidden.

License

This code is distributed under the terms and conditions of the MIT license.

You might also like...
A metaball loading written in Swift.

DBMetaballLoading Synopsis A metaball loading written in Swift. Special thanks to dodola's MetaballLoading, which is an android project. The animation

Completely customizable progress based loaders drawn using custom CGPaths written in Swift
Completely customizable progress based loaders drawn using custom CGPaths written in Swift

FillableLoaders Completely customizable progress based loaders drawn using custom CGPaths written in Swift Waves Plain Spike Rounded Demo: Changelog:

A simple animated progress bar in Swift
A simple animated progress bar in Swift

DSGradientProgressView Introduction DSGradientProgressView is a simple and customizable animated progress bar written in Swift. Inspired by GradientPr

Awesome loading animations using 3D engine written with Swift
Awesome loading animations using 3D engine written with Swift

RSLoadingView Introduction RSLoadingView bring your app to the new age of loading animations using 3D engine. Written with Swift Customizable Using Ap

 GUI library for displaying various popups (HUD), written in pure Swift.
GUI library for displaying various popups (HUD), written in pure Swift.

SwiftNotice SwiftNotice is a GUI library for displaying various popups (HUD) written in pure Swift, fits any scrollview and supports iPhone X. Feature

A Swift based reimplementation of the Apple HUD (Volume, Ringer, Rotation,…) for iOS 8.
A Swift based reimplementation of the Apple HUD (Volume, Ringer, Rotation,…) for iOS 8.

A Swift based reimplementation of the Apple HUD (Volume, Ringer, Rotation,…) for iOS 8 and up. Features Official iOS 8 blur effect via UIVisualEffects

A beautiful and easy-to-use progress HUD for your iOS.
A beautiful and easy-to-use progress HUD for your iOS.

日本語 KRProgressHUD is a beautiful and easy-to-use progress HUD for your iOS written by Swift. KRActivityIndicatorView is used for loading view. Feature

TTProgressHUD is a light weight HUD written in SwiftUI meant to display the progress of an ongoing task on iOS.
TTProgressHUD is a light weight HUD written in SwiftUI meant to display the progress of an ongoing task on iOS.

TTProgressHUD TTProgressHUD is a light weight HUD written in SwiftUI meant to display the progress of an ongoing task on iOS. TTProgressHUD (left) was

Customizable HUD for swift

HUD Customizable HUD. Requirements Installation Swift Package Manager The Swift Package Manager is a tool for automating the distribution of Swift cod

Simple Swift Progress HUD

MKProgress An iOS Simple Swift Progress HUD Requirements iOS 9.0+ Swift 3.0+ Xcode 8.0+ Installation MKProgress is only available via CocoaPods: pod '

A clean and lightweight progress HUD based on SVProgressHUD, converted to Swift with the help of Swiftify.

IHProgressHUD IHProgressHUD is a clean and easy-to-use HUD meant to display the progress of an ongoing task on iOS and tvOS. IHProgressHUD is based on

A modern HUD inspired by Apple Music and Apple Podcasts
A modern HUD inspired by Apple Music and Apple Podcasts

HUD A modern HUD inspired by Apple Music and Apple Podcasts. Appearance Light Dark HUD Activity Indicator HUD Requirements iOS 13+ Installation You ca

This is a beauful hud view for iPhone & iPad
This is a beauful hud view for iPhone & iPad

WSProgressHUD This is a beauful hud view for iPhone & iPad Usage To Download the project. Run the WSProgressHUD.xcodeproj in the demo directory. [

Simple HUD.
Simple HUD.

VHUD Simple HUD. VHUD is inspired by PKHUD. Example Show import VHUD func example() { var content = VHUDContent(.loop(3.0)) content.loadingText =

HUDKit provides HUD interface as UIPresentationController.
HUDKit provides HUD interface as UIPresentationController.

HUDKit provides HUD interface as UIPresentationController. Features HUDKit provides HUDPresentationController. This is the HUD interface as an

RAMAnimatedTabBarController is a Swift UI module library for adding animation to iOS tabbar items and icons. iOS library made by @Ramotion
RAMAnimatedTabBarController is a Swift UI module library for adding animation to iOS tabbar items and icons. iOS library made by @Ramotion

ANIMATED TAB BAR Swift UI module library for adding animation to iOS tabbar items and icons.

FCLAuthSwift is a Swift library for the Flow Client Library (FCL) that enables Flow wallet authentication on iOS devices.
FCLAuthSwift is a Swift library for the Flow Client Library (FCL) that enables Flow wallet authentication on iOS devices.

FCLAuthSwift is a Swift library for the Flow Client Library (FCL) that enables Flow wallet authentication on iOS devices. Demo The demo a

Cross-Platform, Protocol-Oriented Programming base library to complement the Swift Standard Library. (Pure Swift, Supports Linux)

SwiftFoundation Cross-Platform, Protocol-Oriented Programming base library to complement the Swift Standard Library. Goals Provide a cross-platform in

SwiftUI Animation Library. Useful SwiftUI animations including Loading/progress, Looping, On-off, Enter, Exit, Fade, Spin and Background animations that you can directly implement in your next iOS application or project. The library also contains huge examples of spring animations such as Inertial Bounce, Shake, Twirl, Jelly, Jiggle, Rubber Band, Kitchen Sink and Wobble effects. Browse, find and download the animation that fits your needs.
Comments
  • Fix broken headings in Markdown files

    Fix broken headings in Markdown files

    GitHub changed the way Markdown headings are parsed, so this change fixes it.

    See bryant1410/readmesfix for more information.

    Tackles bryant1410/readmesfix#1

    opened by bryant1410 0
  • Updated for Swift 1.2

    Updated for Swift 1.2

    These are the changes I had to make on my local copy to get it to compile and run. Please feel free to modify this, but would be nice to make the master 1.2 compliant either way.^^

    opened by mclark4386 0
  • CocoaPods support

    CocoaPods support

    Why don't you add this great project to cocoa pods?

    P.S. I like this HUD libarary! showInView approach is very good. I hate blocking all user-interactions, I want to allow back ,close or change tabs. thank you.

    opened by AknEp 3
Releases(1.0.0)
Owner
Harikrishnan T
Harikrishnan T
A clean and lightweight progress HUD based on SVProgressHUD, converted to Swift with the help of Swiftify.

IHProgressHUD IHProgressHUD is a clean and easy-to-use HUD meant to display the progress of an ongoing task on iOS and tvOS. IHProgressHUD is based on

Swiftify 202 Dec 22, 2022
This is a beauful hud view for iPhone & iPad

WSProgressHUD This is a beauful hud view for iPhone & iPad Usage To Download the project. Run the WSProgressHUD.xcodeproj in the demo directory. [

Wilson 583 Dec 6, 2022
Simple HUD.

VHUD Simple HUD. VHUD is inspired by PKHUD. Example Show import VHUD func example() { var content = VHUDContent(.loop(3.0)) content.loadingText =

Airin 138 Jan 24, 2021
A beautiful activity indicator and modal alert written in Swift (originally developed for my app DoodleDoodle) Using blur effects, translucency, flat and bold design - all iOS 8 latest and greatest

SwiftSpinner SwiftSpinner is an extra beautiful activity indicator with plain and bold style. It uses dynamic blur and translucency to overlay the cur

Marin Todorov 2.1k Dec 19, 2022
The easiest way to handle a simple full screen activity indicator in iOS. Written in Swift.

LLSpinner An easy way to handle full screen activity indicator. Easy to use Get Started // Show spinner LLSpinner.spin() // Hide spinner LLSpinner.st

Aleph Retamal 36 Dec 9, 2021
A view class for iOS that makes uploading easy and beautiful.

SVUploader A view class for iOS that makes uploading easy and beautiful. Demo SVUploader is fully customizable - check out 2 demos. Installation Just

Kiran 79 Apr 18, 2022
Flexible Stepped Progress Bar for IOS

FlexibleSteppedProgressBar This is a stepped progress bar for IOS. The base code is derived from ABSteppedProgressBar. Most of the design is customisa

Amrata Baghel 549 Jan 6, 2023
A lightweight and awesome loading Activity Indicator for your iOS app.

BPCircleActivityIndicator BPCircleActivityIndicator is a clean and easy-to-use Activity Indicator meant to display the progress of an ongoing task on

Ben.Park 46 Aug 12, 2022
A simple and awesome loading Activity Indicator(with block moving animation) for your iOS app.

BPBlockActivityIndicator BPBlockActivityIndicator is a clean and easy-to-use Activity Indicator meant to display the progress of an ongoing task on iO

Ben.Park 43 Nov 6, 2021
Material Linear Progress Bar for your iOS apps

LinearProgressBar Material Linear Progress Bar for your iOS apps Installation Carthage: github "Recouse/LinearProgressBar" CocoaPods: Add this to you

Firdavs Khaydarov 161 Dec 5, 2022