Skip to content

Instantly share code, notes, and snippets.

@BrettBukowski
Created October 26, 2012 02:46
Show Gist options
  • Save BrettBukowski/3956617 to your computer and use it in GitHub Desktop.
Save BrettBukowski/3956617 to your computer and use it in GitHub Desktop.
Get the application frame, accounting for current interface orientation
+ (CGRect) currentApplicationFrame {
CGRect appFrame = [[UIScreen mainScreen] applicationFrame];
if (UIInterfaceOrientationIsLandscape([[UIApplication sharedApplication] statusBarOrientation])) {
return CGRectMake(0.0, 0.0, appFrame.size.height, appFrame.size.width);
}
return appFrame;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment