Get Application's main window
UIApplication has a method keyWindow, however if an alert view is showing then this returns the window of the alert view and not the main window of the application.
How can I get the app's main window?