Install any skill in seconds. Free to start, no credit card required.
Get Started Free →iOS layout & spacing for iPhone — the 8pt grid convention + 4pt sub-grid, real Apple layout numbers (16/20pt system margins, safe-area insets, 44/49/50pt bar heights), the 44pt touch target, building dense low-scroll layouts with LazyVGrid/Grid + GridItem (2-up/3-up rules), SwiftUI's adaptive default spacing, and the iOS 26 floating-chrome layout model. Use when laying out any iPhone screen, choosing margins/gutters, or building a grid.
| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-02 | ✗→✓ | ▲ Improved | 68% | 0% |
| case-13 | ✗→✓ | ▲ Improved | 46% | 0% |
| case-17 | ✗→✓ | ▲ Improved | 73% | 0% |
| case-18 | ✗→✓ | ▲ Improved | 49% | 0% |
| case-10 | ✓→✗ | ▼ Worse | 56% | 0% |
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]
ios-liquid-glass-swiftui.GregCard padding to a grid multiple; one 16pt screen gutter, one consistent inter-card gap.LazyVGrid for the macro tiles (protein/carbs/fat/cost) instead of stacking full-width cards — cuts vertical scroll, each tile ≈170pt.safeAreaInsets for any custom bottom affordance; never hard-code a bottom pad above the tab bar.VStack(spacing:) explicitly everywhere (don't rely on the adaptive default) so the rhythm is intentional.Pairs with: ios-typography (type rhythm), ios-liquid-glass-swiftui (floating chrome), dense-no-scroll-layout (cross-platform density), ios-components (bar heights/insets).
Other measured skills in the registry, with their headline benchmark lift.