title: Detecting iPhone6 & iPhone6 Plus using macros
body: <p>I am attempting to detect whether the current device is iPhone5, iPhone6 or iPhone 6 Plus.</p>
  
  <p>In my app I am already using this macro to detect iPhone 5 which works perfectly.</p>
  
  <pre><code>#define IS_IPHONE_5      (fabs((double)[[UIScreen mainScreen]bounds].size.height - (double)568) &lt; DBL_EPSILON)
  </code></pre>
  
  <p>Similarly, I use this macro to detect iPhone 6 and iPhone 6 Plus.</p>
  
  <pre><code>#define IS_IPHONE_6      (fabs((double)[[UIScreen mainScreen]bounds].size.height - (double)667) &lt; DBL_EPSILON)
  #define IS_IPHONE_6_PLUS (fabs((double)[[UIScreen mainScreen]bounds].size.height - (double)736) &lt; DBL_EPSILON)
  </code></pre>
  
  <p>The IS_IPHONE_5 macro works as expected in any orientation.</p>
  
  <p>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?</p>
  
  <p>Also if anyone has a better recommendation to detect iPhone5, 6 and 6 Plus please share.</p>