Possible Duplicate:
How to detect iPhone 5 (widescreen devices)?
Does anybody know a better way to detect whether the device is an iPhone 5 than checking the screen height?
[UIScreen mainScreen].bounds.size.height == 568.0;
Thanks in advance.
Possible Duplicate:
How to detect iPhone 5 (widescreen devices)?
Does anybody know a better way to detect whether the device is an iPhone 5 than checking the screen height?
[UIScreen mainScreen].bounds.size.height == 568.0;
Thanks in advance.
I use the following macro:
#define IS_IPHONE ( [[[UIDevice currentDevice] model] isEqualToString:@"iPhone"] )
#define IS_HEIGHT_GTE_568 [[UIScreen mainScreen ] bounds].size.height >= 568.0f
#define IS_IPHONE_5 ( IS_IPHONE && IS_HEIGHT_GTE_568 )
And then i can do:
if(IS_IPHONE_5)
{
NSLog(@"i am an iPhone 5!");
}
else
{
NSLog(@"This is not an iPhone 5");
}