Possible Duplicate:
How to detect iPhone 5 (widescreen devices)?
We can differentiate iPad and iPhone using
UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone/UIUserInterfaceIdiomPad
But how to differentiate between iPhone 4 and iPhone 5 according to the user
Quoting this post:
Then simply check with:
Mind you, you don’t have to define this as a macro if you don’t want to. Simplified version:
And yes this works in landscape. Even though the orientation of the device has changed, the devices height remains the same. Getting the height of UIScreen is different then for example getting the height of a view.