Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MBProgressHud View Customization Not Work In Swift 3 And Not Showing?

i am using the following code but not showing progress hud so please help for that.simple hud showing fine but customise not showing

let loadingHUD = MBProgressHUD() 

loadingHUD.mode = MBProgressHUDModeCustomView
loadingHUD.labelText = nil
loadingHUD.detailsLabelText = nil
let customView = UIView.init(frame: CGRect(x: 0, y: 0, width: 80, height: 80))

let gifmanager = SwiftyGifManager(memoryLimit:20)
let gif = UIImage(gifName: "miniballs1.gif")
let imageview = UIImageView(gifImage: gif, manager: gifmanager)
imageview.frame = CGRect(x: 0 , y: 0, width: customView.frame.width, height: customView.frame.height)
customView.addSubview(imageview)
customView.bringSubview(toFront: imageview)

loadingHUD.customView = customView
loadingHUD.customView.bringSubview(toFront: customView)
loadingHUD.show(true)
like image 864
BHAVIK Avatar asked Jun 21 '17 06:06

BHAVIK


1 Answers

Try with this library ACProgressHud-Swift

In xib file whatever view make then customise and use it.

For Show

ACProgressHUD.shared.showHUD(withStatus: “Your Message Name“)

For hide

ACProgressHUD.shared.hideHUD()
like image 133
Maulik Patel Avatar answered Sep 29 '22 07:09

Maulik Patel