Skip to content

Instantly share code, notes, and snippets.

@maniak-dobrii
Created September 14, 2018 13:07
Show Gist options
  • Save maniak-dobrii/f6d7ad10f187097934d1694e11b151ac to your computer and use it in GitHub Desktop.
Save maniak-dobrii/f6d7ad10f187097934d1694e11b151ac to your computer and use it in GitHub Desktop.
// numi script
// screen width in UIKit points
width_p = 414
// screen height in UIKit points
height_p = 896
// screen diagonal in inches
diagonal_i = 6.5
// screen diagonal in points
diagonal_p = sqrt(width_p * width_p + height_p * height_p)
// uppi <=> up_p_i, where "up" is "UIKit Point"
uppi = diagonal_p / diagonal_i
// UIKit Points per Inch
iPhone4: 162.96
iPhone5: 162.98
iPhone6: 160.96
iPhone6+: 153.54
iPhoneX: 154.21
iPhoneXr: 164.81
iPhoneXmax: 151.85
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment