Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Explains iPhone layout spacing: 8pt grid, 16/20pt margins, safe-area and bar heights, 44pt touch targets, and LazyVGrid/Grid column rules.
Use this skill ↓82% 95%+14 ptsof test cases passed
Passed 21 of 22 test cases with the skill, and 18 of 22 without it.
3 of 3 safety checks passed
Not used yet
Source: Apple HIG Layout, UIKit/SwiftUI API docs, and the 8pt-grid convention (June 2026). Numbers tagged [Apple] (stated in HIG/API) or [convention] (community practice that aligns with Apple's point system — Apple publishes no mandatory pixel grid).
iOS measures in points (1pt = 1px @1x, 2px @2x, 3px @3x). Snap spacing/sizing to multiples of 8 so they land on whole pixels at every scale (@2x→16, @3x→24) and scale cleanly across devices. Use a 4pt sub-grid for finer/typographic spacing and baseline alignment.
systemMinimumLayoutMargins resolve to 16pt on compact-width iPhones, 20pt on larger widths. [Apple behavior / widely-cited] This is why inset-grouped lists and large titles share a left edge.directionalLayoutMargins — Apple's leading/trailing-aware default content spacing (use this, not left/right). [Apple]readableContentGuide — caps text width for readability; never exceeds the layout-margin guide and widens with Dynamic Type. Use for long body text. [Apple]safeAreaInsets: nav bar 44pt (large-title adds a second row), tab bar ~49–50pt, toolbar 44pt (50 on iPad). Status bar / Dynamic Island top inset is device-dependent. Apple's rule: read safeAreaInsets.top/.bottom. [Apple]viewRespectsSystemMinimumLayoutMargins (default true) keeps root margins ≥ the system minimums. [Apple]LazyVGrid/LazyHGrid — lazy, renders only visible cells; for long/scrolling collections.Grid/GridRow (iOS 16+) — eager, for small fixed 2D layouts where you want column alignment across rows.GridItem controls columns:
.fixed(w) — exact-width column..flexible(min:max:) — splits width equally; use for explicit 2-up/3-up card grids: Array(repeating: .flexible(), count: 2)..adaptive(minimum:) — fits as many columns as possible at a min width; for variable counts (chips, photo grids).GridItem(spacing:) = inter-column gap; the grid's spacing: = row gap.VStack/HStack with spacing: nil (the default) is adaptive — SwiftUI picks a distance per pair of subviews by type/platform; the "8pt default" is an approximation, not a constant. For a strict 8pt grid, set spacing explicitly (VStack(spacing: 8)). [Apple behavior]
listRowInsets sets per-row padding; inset-grouped horizontal insets come from the table's layoutMargins (the 16/20pt system margins) — which is why inset-grouped cards align with large-title text. [Apple]Nav bar + toolbars + tab bar render as floating Liquid Glass elements and content scrolls underneath them (vs old opaque bars that shrank the content frame). [Apple]
Skills that do similar work, with their benchmark result.
Next to this one in the catalogue, plus more from the same author.