title: iOS device real size in inches
body: <p>I've looked a lot of post about iOS how to retrieve the real size.
  I found such solution but I think it doesn't work correctly for all devices.</p>
  
  <pre><code>+(float) getRealSize {
      float scale = 1;
      if ([[UIScreen mainScreen] respondsToSelector:@selector(scale)]) {
          scale = [[UIScreen mainScreen] scale];
      }
      float dpi;
      if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
          dpi = 132 * scale;
      } else if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) {
          dpi = 163 * scale;
      } else {
          dpi = 160 * scale;
      }
      CGRect originalFrame = [[UIScreen mainScreen] bounds];
      float w = originalFrame.size.width;
      float h = originalFrame.size.height;
      return dpi * sqrtf(w*w + h*h);
  }
  </code></pre>
  
  <p>How to update such method to support all devices?
  I want DPI (PPI) or inches.
  Or, may be, is there any library to help. </p>
  
  <p>To prevent closing as dublicated: there is no proper solutions in stackoverflow.
  For, instance,
  <a href="https://stackoverflow.com/questions/8257947/ios-get-physical-screen-size-programmatically">iOS get physical screen size programmatically?</a>
  <a href="https://stackoverflow.com/questions/14517356/getting-the-physical-screen-size-in-inches-for-iphone">Getting the physical screen size in inches for iPhone</a>
  <a href="https://stackoverflow.com/questions/5677716/how-to-get-the-screen-width-and-height-in-ios">How to get the screen width and height in iOS?</a>
  etc.,etc.,etc... no solution now.</p>