How to use MBProgressHUD with swift

后端 未结 10 1735
北海茫月
北海茫月 2020-12-08 02:23

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          


        
10条回答
  •  爱一瞬间的悲伤
    2020-12-08 02:36

    Go through the below code

    class ViewController: UIViewController, MBProgressHUDDelegate {
        var hud : MBProgressHUD = MBProgressHUD()
        func fetchData() {
            hud = MBProgressHUD.showHUDAddedTo(self.view, animated: true)
            hud.mode = MBProgressHUDModeIndeterminate
            hud.labelText = "Loading"
        }
    }
    

    If you want to dismiss the HUD

    MBProgressHUD.hideHUDForView(self.view, animated: true)
    

提交回复
热议问题