Possible Duplicate:
How to detect iPhone 5 (widescreen devices)?
Is there a way I can detect if the current device is the iphone 5? More specifically if it's using the new 4" screen?
Use this
#define IS_IPHONE5 (([[UIScreen mainScreen] bounds].size.height-568)?NO:YES)
I think you should concentrate on preferred display mode, rather than detecting iPhone5. Who knows what devices Apple will manufacture, but if your software supports that mode, it will be futureproof.
BOOL isiPhone5 = CGSizeEqualToSize([[UIScreen mainScreen] preferredMode].size,CGSizeMake(640, 1136));
In the future, folks might want to change preferred display mode on the fly. For example disconnect AppleTV from 720p tv and plug to 1080p, without restarting the app of course.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With