Created
September 24, 2012 14:04
-
-
Save benvium/3776108 to your computer and use it in GitHub Desktop.
Force iOS 6 app portrait only (add to a UIViewController subclass).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* in iOS 5 | |
| // Force app to be portrait-only | |
| - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation | |
| { | |
| return (interfaceOrientation == UIInterfaceOrientationPortrait); | |
| } | |
| */ | |
| // iOS 6 interface orientation support. Only rotate on iPad. | |
| - (BOOL)shouldAutorotate { | |
| if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) { | |
| return YES; | |
| } else { | |
| return NO; | |
| } | |
| } | |
| // iOS 6 interface orientation support. Only rotate on iPad. | |
| - (NSUInteger)supportedInterfaceOrientations { | |
| if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) { | |
| return UIInterfaceOrientationMaskAll; | |
| } else { | |
| return UIInterfaceOrientationMaskPortrait; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment