Option1 use KVC
id appDelegate = [UIApplication sharedApplication].delegate; UIWindow *window = [appDelegate valueForKey:@"window"];
Option2 use keywindow property of UIApplication
UIWindow *keyWindow = [[UIApplication sharedApplication] keyWindow];
This property holds the UIWindow object in the windows array that is most recently sent the makeKeyAndVisible message.
Option3 use windoss property of UIApplication
NSArray *array = [[UIApplication sharedApplication] windows];
This property contains the UIWindow objects currently associated with the app. This list does not include windows created and managed by the system, such as the window used to display the status bar.
The windows in the array are ordered from back to front by window level; thus, the last window in the array is on top of all other app windows.