-1

I would like to add a loading dialog into my application like the ones Apple uses in the Settings application. I am speaking of this one:

turn off reminders loading dialog

1) How do I create this popup? and
2) How can I customize the text shown underneath the UIActivityIndicator?

gm_
  • 598
  • 6
  • 22
  • create a view and designed it as above and wheerever required just add it to your subview and start animating and then stop as per your convient – Shobhakar Tiwari May 19 '17 at 17:49
  • I am just wondering if there is something like this already built into Swift/iOS. – gm_ May 19 '17 at 17:51
  • Then go with @pesch answer , PKHUD install through pod , it wil help – Shobhakar Tiwari May 19 '17 at 18:06
  • Try this out. MBProgressHUD.You have to handle asynchronous operation rather than creating the UI.I am using this in my app. https://github.com/jdg/MBProgressHUD – elk_cloner May 19 '17 at 18:16

1 Answers1

0

Try this class from Matthis Hollemans (Ray Wenderlich):

import UIKit

class HudView: UIView {
    var text = ""
    class func hud(inView view: UIView, animated: Bool) -> HudView {
        let hudView = HudView(frame: view.bounds)
        hudView.isOpaque = false
        view.addSubview(hudView)
        view.isUserInteractionEnabled = false
        hudView.backgroundColor = UIColor(red: 0, green: 0, blue: 0, alpha: 0.5)
    return hudView
  }
}

Once having this class you can instantiate it like this:

let hudView = HudView.hud(inView: parentView, animated: true)
hudView.text = "Turning Off Reminders..."
pesch
  • 1,976
  • 2
  • 17
  • 29