I have a UIWindow
nested above all of my navigation controllers (it's a swipeable, draggable mini video player). I'm initializing it like this:
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
let player = CustomWindowClass(frame:UIScreen.mainScreen().bounds)
var window: UIWindow? {
set {
}
get {
return player
}
}
}
Now that player
has a button on it's page that should prompt a UIAlertController
. My problem is that I can't presentViewController:
directly from the UIWindow
. I can use:
let rootView = UIApplication.sharedApplication().keyWindow?.rootViewController
rootView?.presentViewController(theAlertController, animated: true, completion: nil)
..but it appears behind my UIWindow
. I've been searching all day for how I can safely display the UIAlertController
above my UIWindow
, but have been empty-handed. Any suggestions?