Skip to content

Instantly share code, notes, and snippets.

@percysnoodle
Created August 12, 2013 08:51
Show Gist options
  • Save percysnoodle/6209249 to your computer and use it in GitHub Desktop.
Save percysnoodle/6209249 to your computer and use it in GitHub Desktop.
windowsWithKeyWindow with main window
- (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