Scenario: The user taps on a button on a view controller. The view controller is the topmost (obviously) in the navigation stack. The tap invokes a utility class method call
I posted a similar question a couple months ago and think I've finally solved the problem. Follow the link at the bottom of my post if you just want to see the code.
The solution is to use an additional UIWindow.
When you want to display your UIAlertController:
window.makeKeyAndVisible()
)window.rootViewController = UIViewController()
)A couple things to note:
window.windowLevel = UIWindowLevelAlert + 1
)Lastly, I have a completed implementation if you just want to look at that.
https://github.com/dbettermann/DBAlertController