Skip to content

Instantly share code, notes, and snippets.

@danielctull
Last active December 20, 2015 13:29
Show Gist options
  • Select an option

  • Save danielctull/6139449 to your computer and use it in GitHub Desktop.

Select an option

Save danielctull/6139449 to your computer and use it in GitHub Desktop.
- (NSUInteger)supportedInterfaceOrientations {
switch ([[UIDevice currentDevice] userInterfaceIdiom]) {
case UIUserInterfaceIdiomPad:
return UIInterfaceOrientationMaskLandscape;
case UIUserInterfaceIdiomPhone:
return UIInterfaceOrientationMaskPortrait;
}
}
@PeteC

PeteC commented Aug 2, 2013

Copy link
Copy Markdown
  • (NSUInteger) supportedInterfaceOrientations {

    switch ((UIUserInterfaceIdiom)UI_USER_INTERFACE_IDIOM()) {

    case UIUserInterfaceIdiomPad:
        return UIInterfaceOrientationMaskLandscape;
    
    case UIUserInterfaceIdiomPhone:
        return UIInterfaceOrientationMaskPortrait;
    

    }
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment