I'm trying to add an alertView
before the notification/control center is visible with 2 buttons
. One button
would be "ok" and the notification/control center should then open. The second button
should be cancel, and the notification/control center should not be displayed.
I tried adding an alertView
in applicationWillResignActive
like so:
func applicationWillResignActive(application: UIApplication) {
var alert = UIAlertController(title: "Alert", message: "Message", preferredStyle: UIAlertControllerStyle.Alert)
alert.addAction(UIAlertAction(title: "Ok", style: UIAlertActionStyle.Default, handler: nil))
alert.addAction(UIAlertAction(title: "Cancel", style: UIAlertActionStyle.Default, handler: nil))
self.presentViewController(alert, animated: true, completion: nil)
}
When the user tries opening notification/control center, it opens slightly, then closes and the alertView
is shown. How can I make the alertView
show without the notification/control center opening?