Skip to content

riteshhgupta/RGProgressHUD

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

RGProgressHUD

RGProgressHUD is an iOS progress HUD written in Swift. You can configure it with three modes - normal, blur & custom. It allows you to change appreance of various UI aspects like tintColor, backgroundColor, alpha etc.

Example

let hud = RGProgressHUD()

// there are two ways to show
hud.show()
hud.show(on: view)

// one function to hide
hud.hide()
Normal Tint Blur

Normal mode

It's the most commonly used mode which shows a loader with a translucent overlay. You can update a couple of UI aspects, checkout RGProgressHUDAppearance for more info.

		
	func basicHUD() -> RGProgressHUD {
		return RGProgressHUD()
	}

	func differentTintHUD() -> RGProgressHUD {
		let appearance = RGProgressHUDAppearance()
		appearance.indicatorColor = .yellow
		let mode = RGProgressHUDMode.normal(appearance)
		
		let hud = RGProgressHUD(mode: mode)
		return hud
	}

Blur mode

It allows you to add a loader with full screen blurred background. You can update a couple of UI aspects, checkout RGProgressHUDAppearance for more info.

	func blurHUD() -> RGProgressHUD {
		let appearance = RGProgressHUDAppearance()
		appearance.blurEffectStyle = .dark
		let mode = RGProgressHUDMode.blur(appearance)
		
		let hud = RGProgressHUD(mode: mode)
		return hud
	}

Custom mode

It allows you to add a custom view as a loader. This mode only animates the show/hide of your custom view, rest everything is your responsibility.

	func customHUD() -> RGProgressHUD {
		let loader = customLoader
		let mode = RGProgressHUDMode.custom(loader)
		let hud = RGProgressHUD(mode: mode)
		return hud
	}

	var customLoader: UIView {
		let frame = CGRect(x: 0, y: 0, width: 100, height: 100)
		let loader = UIView(frame: frame)
		loader.center = view.center
		loader.backgroundColor = .red
		return loader
	}

...

Installation

Cocoapods

To integrate RGProgressHUD into your Xcode project using CocoaPods, specify it in your Podfile:

pod 'RGProgressHUD', :git => 'https://github.com/riteshhgupta/RGProgressHUD.git'

Internal Architecture

There are primarily three classes used in RGProgressHUD,

There are couple of examples in the project itself which you can checkout or create an issue or ping me if anything comes up πŸ‘

Contributing

Contributions are welcome and encouraged! Open an issue or submit a pull request πŸš€

Licence

RGProgressHUD is available under the MIT license. See the LICENSE file for more info.

About

RGProgressHUD is an iOS progress HUD written in Swift. You can configure it with three modes - normal, blur & custom.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published