Created
August 12, 2013 08:51
-
-
Save percysnoodle/6209249 to your computer and use it in GitHub Desktop.
windowsWithKeyWindow with main window
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (NSArray *)windowsWithKeyWindow | |
{ | |
NSMutableArray *windows = self.windows.mutableCopy; | |
UIWindow *keyWindow = self.keyWindow; | |
if ([windows containsObject:keyWindow]) { | |
[windows removeObject:keyWindow]; | |
} | |
[windows insertObject:keyWindow atIndex:0]; | |
UIWindow *mainWindow = [self.delegate window]; | |
if ([windows containsObject:mainWindow]) { | |
[windows removeObject:mainWindow]; | |
} | |
[windows insertObject:mainWindow atIndex:0]; | |
return [windows autorelease]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment