SwiftUI reference pages, page 4
Continue browsing practical SwiftUI examples, API notes, pitfalls, and implementation checklists.
containerRelativeFrame sizes a view as a fraction of its nearest container — full width, one-of-three columns, or custom math — without GeometryReader.
Modern ScrollView is configured declaratively: scrollTargetBehavior for paging and snapping, scrollPosition for tracking, contentMargins for insets, plus bounce and disable controls.
ScrollViewReader exposes a proxy whose scrollTo(_:anchor:) jumps to any child with an id — chat bottoms, section indexes, and back-to-top buttons.
Lazy stacks create children only as they scroll into view and support section headers that pin to the edge while their section passes.
LazyHGrid scrolls horizontally and fills rows defined by GridItem heights — the sideways twin of LazyVGrid for shelf and timetable layouts.
Restyle List without leaving it: listRowBackground, listRowInsets, separator visibility and tint, listRowSpacing, listSectionSpacing, and scrollContentBackground.
swipeActions adds leading and trailing buttons with full-swipe control, refreshable wires async pull-to-refresh, and badge annotates rows with counts.