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:
1) How do I create this popup? and
2) How can I customize the text shown underneath the UIActivityIndicator?
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:
1) How do I create this popup? and
2) How can I customize the text shown underneath the UIActivityIndicator?
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..."