Can you disable rotation globally in an iOS app?
There are three kinds of Device orientation keys there in the info.plist
now.
- Supported interface orientations (iPad)
- Supported interface orientations (iPhone)
- Supported interface orientations
Third one is I think for non-universal apps and rest two above are for iPad and iPhone.
You should give them a try.
After struggling to set in UIViewController's shouldAutorotate
and supportedInterfaceOrientation
methods, with no success in iOS6, I found the most effective is to set it in app delegate.
- (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window{ return UIInterfaceOrientationMaskPortrait;}
However returning UIInterfaceOrientationMaskPortraitUpsideDown
was crashing my app. I dont know whats wrong I was doing!