Search code examples
swiftmbprogresshud

MBProgressHUD different load styles


I am having some issues to get MBProgressHUDModeDeterminateHorizontalBar style to work

Haven't found much around on Swift.

I've tried so far to create an object passing the MBProgressHUDModeDeterminateHorizontalBar as type or attribute it as a mode to an existing HUB object or add an int to the mode... but nothing seems to work.

let spinningActivity = MBProgressHUD.showHUDAddedTo(self.view, animated: true)
spinningActivity.labelText = "Loading"
spinningActivity.detailsLabelText = "Please got get some coffee"

Solution

  • You need to change MBProgressHUD mode. See code bellow.

    spinningActivity.mode = .DeterminateHorizontalBar
    

    And update your loading progress:

    spinningActivity.progress = /*Your loading progress*/
    

    Hope that help!