I have following Controllers, (I have selected all types orientation modes in iPad)
Here is my iPad Storyboard layout
Custom NavigationController >
- (BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation{
return (interfaceOrientation == UIInterfaceOrientationPortrait);//choose portrait or landscape
}
- (BOOL) shouldAutorotate{
return NO;
}
- (NSUInteger) supportedInterfaceOrientations{
return UIInterfaceOrientationMaskPortrait;//choose portrait or landscape, same as above
}
There is one trick.
Fetch the status bar from the Application and rotate it.
[[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationPortrait animated:YES];
Create and display and dismiss an empty view controller modally.
UIViewController *mVC = [[UIViewController alloc] init];
[self presentModalViewController:mVC animated:NO];
[self dismissModalViewControllerAnimated:NO];
Now your device shoud have been forced to rotate. You could now segue to a proper view controller or push one using the navigation controller.