Skip to content

Instantly share code, notes, and snippets.

@maxchuquimia
Last active August 29, 2015 14:16
Show Gist options
  • Save maxchuquimia/e227234bd77db0808fa2 to your computer and use it in GitHub Desktop.
Save maxchuquimia/e227234bd77db0808fa2 to your computer and use it in GitHub Desktop.
Determine Portrait or Landscape from iOS Extension
//This is currently working in my Keyboard Extension (not upside-down friendly)
- (BOOL)isPortrait {
CGFloat portraitWidth = [[UIScreen mainScreen] nativeBounds].size.width/[UIScreen mainScreen].scale;
CGFloat thisWidth = [[UIScreen mainScreen] bounds].size.width;
return portraitWidth == thisWidth;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment