Install any skill in seconds. Free to start, no credit card required.
Get Started Free →rshankras/layout
SwiftUI layout beyond stacks — the Layout protocol (when custom layout beats GeometryReader), Grid vs lazy grids, custom containers with sections and container values, and lazy-stack/ScrollView performance rules (what breaks laziness, prefetch discipline, scroll APIs).
Passed 22 of 22 test cases with the skill, and 19 of 22 without it.
and 1 more in the full report
3 fixed19 passed either way0 still failing0 broke
Tokens, turns and time describe resource use, not a dollar price.
One of 3 test cases the skill fixed. Same model, same prompt, with and without the skill.
I want to trigger an analytics log when a item in a LazyVStack becomes 80% visible. I attached `onScrollGeometryChange` to inspect absolute content offsets, but offset estimation in lazy stacks causes inaccurate triggers. Which scroll API should be used instead for tracking row visibility?
| Checked | Without skill | With skill |
|---|---|---|
| Recommends onScrollTargetVisibilityChange or onScrollVisibilityChange for visibility triggers | Missed | Passed |
The instructions your model reads when the skill loads.
The layer between "stacks and spacers" and "it scrolls like butter with 100k rows" — Apple's
Layout protocol, container composition, and the lazy-stack rules from the WWDC26 deep dive.
View identity/data-flow questions route to swiftui/data-flow.
Reach for a custom Layout whenever you must measure subviews and feed the measurement back
into layout — GeometryReader only measures its container and can't influence the engine.
Canonical case: equal-width buttons.
sizeThatFits: propose .unspecified to read each subview's ideal size
(subviews.map { $0.sizeThatFits(.unspecified) }); guard empty subviews;
replacingUnspecifiedDimensions() for nil proposal dimensions.placeSubviews: never assume origin (0,0) — use bounds.minX/midX (non-zero origins are
what make layouts composable); place(at:anchor:proposal:) with a proposal that may differ
from the ideal size (that's how equal widths happen).subviews[i].spacing.distance(to:along:), taking the larger
of conflicting preferences — matching built-in containers. No hardcoded 8s.LayoutValueKey (+ a layoutValue convenience modifier), read as
subview[Key.self].AnyLayout(HStackLayout()) ↔ custom layout with
.animation(_:value:) — SwiftUI sees one changing view, so state survives and it animates.ViewThatFits.| Need | Use |
|---|---|
| Static 2D with cross-row alignment | Grid/GridRow (+ gridCellColumns to span, gridColumnAlignment per column) |
test cases passed, vs 19 / 22 without
More skills from the same source and nearby in the registry, with their headline benchmark lift.