I'm writing an iPad app, and I'm trying to display a second UIWindow
on top of the main window in my app. The main thing I'm trying to do is create a log in window (how to present a login, with UISplitViewController?), and it seems that creating a second window here might be a good option.
I've made a very simple app to try this out. When the user hits a button, then I'm trying to show the second window. Here's the code:
- (IBAction)showOtherWindow:(id)sender {
UIWindow* otherWindow = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
otherWindow.hidden = NO;
otherWindow.clipsToBounds = YES;
otherWindow.windowLevel = UIWindowLevelStatusBar;
otherWindow.backgroundColor = [UIColor redColor];
[otherWindow makeKeyAndVisible];
}
I'm expecting to see a big red screen here, but that doesn't happen - nothing changes. Ultimately, I'd like to have a smaller window floating on top. But right now I'd just like to see a window at all.