I used to have a \"Please wait\" dialog in my app for long time. It was quite simple thing using UIActivityIndicatorView and adding it to
Swift 2.0:
override func viewDidAppear(animated: Bool)
{
let alertController = UIAlertController(title: nil, message: "Please wait\n\n", preferredStyle: UIAlertControllerStyle.Alert)
let spinnerIndicator: UIActivityIndicatorView = UIActivityIndicatorView(activityIndicatorStyle: UIActivityIndicatorViewStyle.WhiteLarge)
spinnerIndicator.center = CGPointMake(135.0, 65.5)
spinnerIndicator.color = UIColor.blackColor()
spinnerIndicator.startAnimating()
alertController.view.addSubview(spinnerIndicator)
self.presentViewController(alertController, animated: false, completion: nil)
}
After some point, we need to hide the alert.
alertController.dismissViewControllerAnimated(true, completion: nil)