I use the following code to determine which device is working (it is a little quick and dirty, but it does the trick)
if( UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone ){
CGFloat screenHeight = [UIScreen mainScreen].bounds.size.height;
CGFloat screenWidth = [UIScreen mainScreen].bounds.size.width;
if( screenHeight < screenWidth ){
screenHeight = screenWidth;
}
if( screenHeight > 480 && screenHeight < 667 ){
DLog(@"iPhone 5/5s");
} else if ( screenHeight > 480 && screenHeight < 736 ){
DLog(@"iPhone 6");
} else if ( screenHeight > 480 ){
DLog(@"iPhone 6 Plus");
} else {
DLog(@"iPhone 4/4s");
}
}
source
share