Skip to content

Instantly share code, notes, and snippets.

@omayib
Created December 13, 2016 03:01
Show Gist options
  • Save omayib/a24194f87e68d8baad4d30cf08846001 to your computer and use it in GitHub Desktop.
Save omayib/a24194f87e68d8baad4d30cf08846001 to your computer and use it in GitHub Desktop.
an implementation of UILoadingViewProtocol class
import PKHUD
extension UILoadingView where Self: UIViewController {
func hideLoading(){
HUD.hide()
}
func showLoading(){
HUD.show(.progress)
}
func showLoadingWithLabel(title:String? = "Waiting", subtitle:String){
HUD.show(.labeledProgress(title: title, subtitle: subtitle))
}
func showErrorWithLabel(message: String){
HUD.flash(.labeledError(title: "Failure", subtitle: message), delay: 1.5)
}
func showSuccessWithLabel(message:String){
HUD.flash(.labeledError(title: "Success", subtitle: message), delay: 1.5)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment