How to use MBProgressHUD with swift

后端 未结 10 1734
北海茫月
北海茫月 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:57

    step 1 : Download "MBProgressHUD.h" and "MBProgressHUD.m" file and Add both file into your project. it will ask you to Bridging for Objective C files. if you already done bridging then it won't ask.

    step 2 : In Bridging File import MBProgressHUD "import MBProgressHUD.h"

    step 3 : use below code to show progress hud or hide hud.

    for Show

    DispatchQueue.main.async {
        MBProgressHUD.showAdded(to: self.view, animated: true)
    }
    

    for hide

    DispatchQueue.main.async {
        MBProgressHUD.hide(for: self.view, animated: true)
    }
    

提交回复
热议问题