Last active
August 29, 2015 14:07
-
-
Save frijole/3eafc99cfbc5bd2e96ae to your computer and use it in GitHub Desktop.
supportedInterfaceOrientations implementation that allows all orientations on iPad, all but upside-down on the iPhone 6 Plus, and portrait-only for others. But it feels dirty...
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
- (NSUInteger)supportedInterfaceOrientations | |
{ | |
UIInterfaceOrientationMask rtnOrientationMask = UIInterfaceOrientationMaskPortrait; | |
if ( UIDevice.currentDevice.userInterfaceIdiom == UIUserInterfaceIdiomPad ) { | |
rtnOrientationMask = UIInterfaceOrientationMaskAll; | |
} else if ( [UIScreen mainScreen].bounds.size.height > 600.0f || [UIScreen mainScreen].bounds.size.width > 600.0f ) { | |
rtnOrientationMask = UIInterfaceOrientationMaskAllButUpsideDown; | |
} else { | |
rtnOrientationMask = UIInterfaceOrientationMaskPortrait; | |
} | |
return rtnOrientationMask; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment