Skip to content

Instantly share code, notes, and snippets.

@frijole
Last active August 29, 2015 14:07
Show Gist options
  • Save frijole/3eafc99cfbc5bd2e96ae to your computer and use it in GitHub Desktop.
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...
- (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