I\'d like to display a temporary message on the iPhone/iPad displaying confirmation of an action, or some quick status about some background activity.
Is there a st
*Swift 2.2 Answer:
func showPopupWithTitle(title: String, message: String, interval: NSTimeInterval) {
let alertController = UIAlertController(title: title, message: message, preferredStyle: .Alert)
presentViewController(alertController, animated: true, completion: nil)
self.performSelector(#selector(dismissAlertViewController), withObject: alertController, afterDelay: interval)
}
func dismissAlertViewController(alertController: UIAlertController) {
alertController.dismissViewControllerAnimated(true, completion: nil)
}
showPopupWithTitle("Title", message: "Message", interval: 0.5)