Reputation: 5112
I am building my app for iOS 7. On a modal view controller, I have the following code for user interface orientation.
- (NSUInteger)supportedInterfaceOrientations {
return UIInterfaceOrientationMaskPortrait;
}
- (BOOL)shouldAutorotate
{
return NO;
}
However, when I rotate my device, it rotates with the device! I should add that this modal view is embedded in a UINavigationController as well.
I appreciate any advice.
Upvotes: 1
Views: 832
Reputation: 5112
Found this post on Apple Dev forums.
https://devforums.apple.com/message/861976#861976
answers the question....if embedded in a UINavigationController, you must subclass the navigation controller to control device rotation that is different from that in your app settings.
Upvotes: 1