2

I am trying to run MBProgressHUD in Swift. I have found I am able to run a spinner that is very similar UIAlert spinner, but that I am having trouble with the other functions. According the MBProgress docs, you can also user a determinate loader as well as other functions including a CustomView which could be loaded as a success. I am trying to figure out how to load and access these other functions in Swift.

This is the current code for the indeterminate spinner (the only function I can get working):

let loadingNotification = MBProgressHUD.showHUDAddedTo(self.view, animated: true)
loadingNotification.mode = MBProgressHUDMode.Indeterminate
loadingNotification.labelText = "Loading"

To dismiss the ProgressHUD:

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

Please excuse such a simple question. I am brand new to programming. Thank you so much for all of your help!

rmaddy
  • 314,917
  • 42
  • 532
  • 579

1 Answers1

1

I think that one month later, you have solve it, but if not, I think this will work for you:

loadingNotification.hide(true)

Or with a delay:

loadingNotification.hide(true, afterDelay: 3)

Hope it helps! :)

Dani G.
  • 577
  • 8
  • 21