Search code examples
iosobjective-ciphonemainscreen

Detecting iPhone 6 and plus


I know there is some questions like this but i got no solution. I am trying to understand if it is iPhone 6 or not.

#define IS_IPHONE_5 (IS_IPHONE && [[UIScreen mainScreen] bounds].size.height == 568.0)
#define IS_IPHONE_6 (IS_IPHONE && [[UIScreen mainScreen] bounds].size.height == 667.0)

When i try this it return IS_IPHONE_5 is true even in iPhone 6. If i try native.scale iphone 5 and 6 also return 2, only iphone 6 plus returns 3. So i cant get it if it is iphone 6 from height or from scale.

 NSStringFromCGRect(mainScreen.bounds), mainScreen.coordinateSpace, mainScreen.scale, mainScreen.nativeScale); 

They are all return same in iPhone 5 and iPhone 6. So how to detect it? any help please.


Solution

  • In order to support native resolution on iPhone 6/6+ you need to either

    • provide properly sized launch images
    • provide XIB file for launch screen