I have UIWindow and it's rootViewController has blue background and allow all kind of orientation changing:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return YES;
}
Then I create new UIWindow with the new rootViewController (SecondViewController):
UIWindow *window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
SecondViewController* secondVC = [[SecondViewController alloc] init];
window.rootViewController = secondVC;
window.windowLevel = UIWindowLevelStatusBar;
[window makeKeyAndVisible];
SecondViewController allows only portrait orientation:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
The most important thing for me that SecondViewController view to be added like popup. So user can see background of previous VC.
But when I rotate device it asks both my VC for - (BOOL)shouldAutoRotate... method, and I got landscape mode, and status bar appears on landscape mode.
Ideally I wonder if deny rotating completely (blue, yellow, status bar won't rotate).
Please, help.