I'm having trouble figuring out how to handle device rotation on iOS 6. I have three things that need to change separately when the device is rotated.
- I have a parent UIViewController that handles multiple sub UIViewControllers or UINavigationControllers (Its basically a custom UITabBarController). I do not want this to rotate.
- Each of these sub view controllers, will either rotate or not rotate depending on its own settings. (I want some to rotate and some to not).
- In the tab bar, I want each tab icon (a UIView) to rotate to the orientation.
How would I go about making this happen in iOS 6, I got everything working in iOS 5.
Here is what I have so far:
In the parent UIViewController:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
{
return UIInterfaceOrientationPortrait;
}
- (BOOL)shouldAutorotate
{
return NO;
}
- (BOOL)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskPortrait;
}
In the sub view controllers:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
{
return YES;
}
- (BOOL)shouldAutorotate
{
return YES;
}
- (BOOL)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskAll;
}