Created
December 13, 2016 03:01
-
-
Save omayib/a24194f87e68d8baad4d30cf08846001 to your computer and use it in GitHub Desktop.
an implementation of UILoadingViewProtocol class
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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