Skip to content

Instantly share code, notes, and snippets.

@priore
Last active February 28, 2016 02:56
Show Gist options
  • Save priore/3d395a97e9a7e5a1fec9 to your computer and use it in GitHub Desktop.
Save priore/3d395a97e9a7e5a1fec9 to your computer and use it in GitHub Desktop.
iOS8: correct screen bounds
static inline CGSize screenSize()
{
CGSize screenSize = [UIScreen mainScreen].bounds.size;
if ((NSFoundationVersionNumber <= NSFoundationVersionNumber_iOS_7_1) && UIInterfaceOrientationIsLandscape(getOrientation())) {
return CGSizeMake(screenSize.height, screenSize.width);
} else {
return screenSize;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment