Skip to content

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

License

Notifications You must be signed in to change notification settings

riteshhgupta/RGProgressHUD

Repository files navigation

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

Contributors 2

  •  
  •