Given the newly announced iPhone 6 screen sizes:
iPhone 6: 1334h * 750w @2x (in points: 667h * 375w)
iPhone 6+: 1920 * 1080 @3x (in points: 640h * 360w)
this is guaranteed to compile in xcode 5 (xocde 6 at this point is still flaky, and you can't submit an ipa to itunes connect for app store approval using beta software, which xcode 6 is right now)
the thing is xcode 5 won't recognize the nativeScale selector.. this is how you can do it in run time:
+ (BOOL)isIphone6Plus
{
SEL selector = NSSelectorFromString(@"nativeScale");
if ([[UIScreen mainScreen] respondsToSelector:selector]) {
NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:
[[[UIScreen mainScreen] class] instanceMethodSignatureForSelector:selector]];
[invocation setSelector:selector];
[invocation setTarget:[UIScreen mainScreen]];
[invocation invoke];
float returnValue;
[invocation getReturnValue:&returnValue];
NSLog(@"::: this is native scale %f", returnValue);
return (returnValue == 3.0f);
} else {
// iphone 6 plus come prepackaged with iOS8..
// so if the phone doesn't know what nativeScale means
// it's not an iphone6plus phone
return NO;
}
}