The difference between a point (pt) and a pixel (px)
The gist
- Pixel (px) — a physical dot of the display.
- Point (pt) — the logical coordinate unit of UIKit, independent of screen density. All layout (
frame, constraints, fonts) is specified in points; the system converts them to pixels when rendering.
Relationship: 1 pt = UIScreen.scale px. On modern iPhones scale is 2 or 3 (@2x, @3x); @1x devices have long been unsupported by iOS. So a 1 pt line on a @3x screen covers 3 physical pixels, and a "one-pixel" separator is drawn with thickness 1 / scale.
The rest of this answer, with code and interview follow-ups, is in the DevPrep app.
Read the full answer in DevPrep