Skip to content

Instantly share code, notes, and snippets.

@romyilano
Created December 17, 2012 00:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save romyilano/4314548 to your computer and use it in GitHub Desktop.
Save romyilano/4314548 to your computer and use it in GitHub Desktop.
CHeck against the screensize of an iPhone 5 or iPhone 4
// source: http://stackoverflow.com/questions/12395200/how-to-develop-or-migrate-apps-for-iphone-5-screen-resolution/12397309#12397309
CGRect screenBounds = [[UIScreen mainScreen] bounds];
if (screenBounds.size.height == 568) {
// code for 4-inch screen
} else {
// code for 3.5-inch screen
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment