here is my code , but it showing the progress . is there any error in this code? please give some idea to fix this, or give some link related to this.
class
Create Extension to Easy to use and throughout application
extension UIViewController {
func showHUD(progressLabel:String){
DispatchQueue.main.async{
let progressHUD = MBProgressHUD.showAdded(to: self.view, animated: true)
progressHUD.label.text = progressLabel
}
}
func dismissHUD(isAnimated:Bool) {
DispatchQueue.main.async{
MBProgressHUD.hide(for: self.view, animated: isAnimated)
}
}
}
USAGE:
1. SHOW - self.showHUD(progressLabel: "Loading...")
2. HIDE - self.dismissHUD(isAnimated: true)