Skip to content

Latest commit

 

History

History
65 lines (52 loc) · 2 KB

README.md

File metadata and controls

65 lines (52 loc) · 2 KB

JustHUD

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

JustHUD is an iOS drop-in class written in Swift that displays a translucent HUD with an indicator and/or labels while work is being done in a background thread.

Installation

Download the JustHUD.swift file and add it into your project target.

Usage

  • Just the loader
JustHUD.shared.showInView(view: view)

  • Add title and footer text
JustHUD.shared.showInView(view: view, withHeader: "Loading", andFooter: "Please wait...")

  • Set color to the header, footer, loader or to the background view
JustHUD.setHeaderColor(color: UIColor.blue)
JustHUD.setFooterColor(color: UIColor.blue)
JustHUD.setLoaderColor(color: UIColor.blue)
JustHUD.setBackgroundColor(color: UIColor.white)

  • Customize: Set color the the background view and let header, footer and loader infer a contrast color
JustHUD.setBackgroundColor(color: UIColor.white, automaticTextColor: true)

  • Or show in a window
JustHUD.shared.showInWindow(window: window, withHeader: "Loading", andFooter: "Please wait...")
  • Hide the HUD
JustHUD.shared.hide()
  • Check if HUD is already being displayed
if JustHUD.shared.isActive {
    print("Currently showing HUD")
} else {
    print("HUD is currently hidden")
}

Contribution

Contribute to JustHUD

Code of Conduct

Contributor Covenant Code of Conduct

License

This code is distributed under the terms and conditions of the MIT license. The background image used in the demo was generated by lorempixel.com service.