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? Espresso The UIApplicationDelegate usually has a reference to the "main window": [[[UIApplication sharedApplication] delegate] window]; Furthermore, UIApplication has an array of windows [[UIApplication sharedApplication] windows] . See the UIApplication Class Reference . I'm not 100% sure this works in every case but this should work: UIWindow *mainWindow = [UIApplication sharedApplication]