I am attempting to detect whether the current device is iPhone5, iPhone6 or iPhone 6 Plus.
In my app I am already using this macro to detect iPhone 5 which works perfectly.
#define IS_IPHONE_5 (fabs((double)[[UIScreen mainScreen]bounds].size.height - (double)568) < DBL_EPSILON)
Similarly, I use this macro to detect iPhone 6 and iPhone 6 Plus.
#define IS_IPHONE_6 (fabs((double)[[UIScreen mainScreen]bounds].size.height - (double)667) < DBL_EPSILON)
#define IS_IPHONE_6_PLUS (fabs((double)[[UIScreen mainScreen]bounds].size.height - (double)736) < DBL_EPSILON)
The IS_IPHONE_5 macro works as expected in any orientation.
My problem is that the IS_IPHONE_6 and IS_IPHONE_6_PLUS macros do not return true when the device is held in LANDSCAPE. However they do work as expect while the device is held in PORTRAIT. What gives?
Also if anyone has a better recommendation to detect iPhone5, 6 and 6 Plus please share.