Your code doesn't work for one of the below reason
1) If you rotate device , check your main screen bounds. It may lead to confusion. You can try Better way to use it.
2) This Default-568h.png
is only allowed when building an app using Xcode 4.5 and the iOS 6 SDK
3) When you ask a UIScreen
for it's Bounds you get the bounds of the screen, which is the whole device screen. (the status bar is part of the screen)
So It may get false
two if
conditions.
You can use this code ..
-(BOOL)isDeviceGreaterThaniPhone5
{
struct utsname systemInfo;
uname(&systemInfo);
NSString *modelName = [NSString stringWithCString:systemInfo.machine
encoding:NSUTF8StringEncoding];
if([modelName isEqualToString:@"iPhone5,1"]) {// @"iPhone 5 (GSM)";
return YES;
}
else if([modelName isEqualToString:@"iPhone5,2"]) {// @"iPhone 5 (GSM+CDMA)";
return YES;
}
else if([modelName isEqualToString:@"iPod5,1"]){ // @"iPod touch 5G";
return YES;
}
return NO;
}
Don't forget to import #import <sys/utsname.h>