Inches between dots iPhone

I need to calculate the distance in inches between two touches on any iOS device.

Is there a way to convert pixels to inches in iOS sdk?

This should work if you install it on any device and even if you install the iPhone app on the iPad and press the 2x button.

Is it possible?

+3
source share
1 answer

You will need to calculate the PPI (pixels per inch) of the display so that you can convert pixels to inches. However, I did not find a way to get these values ​​programmatically. I think you should hardcode it and determine on which device you should decide which PPI value to use. However, this is not salvation in the future.

, Xcode iOS?.

Retina Display , iPhone4.

Erica Sadun uidevice-extension lib.

wikipedia.org.

+3

All Articles