Reputation: 63
I want to dismiss the UIAlertControllers
that were previously presented before presenting a new UIAlertController
. I need to do this from the AppDelegate
. How can this be done. All suggestions are welcome.
Upvotes: 3
Views: 1434
Reputation: 2494
This should help, you can expand it to the cycle for all view controllers and views:
[[UIApplication sharedApplication].keyWindow.rootViewController.view endEditing:YES];
Upvotes: 0
Reputation: 2431
You could find the top presented view controller and check to see if it's a UIAlertController
. If it is, then you could call dismissViewControllerAnimated:
on it. All of this could be done pretty simply from the app delegate.
Upvotes: 4