skip to content

As the lead of a SwiftUI app full of long feeds, how do you set the team standard between List and a lazy stack in a ScrollView?

level: principalimportance: should knowfreq 35%

answer

  1. both load rows lazily
  2. system behaviour versus layout control
  3. what each gives you for free
  4. the deployment target moves the line

basics

~20 s

Default to List for data people select, edit, delete or swipe, since it brings system styling and interactions; use a LazyVStack in a ScrollView for custom feeds needing layout control, pinned headers or scroll-target effects. Revisit when the deployment target reaches iOS 27.

solid answer

~50 s

Both containers load rows lazily, so performance alone rarely decides; Apple describes `List` as conceptually a `LazyVStack` in a `ScrollView` plus platform styling and interactivity. `List` gives selection, edit mode, `onDelete` and `onMove`, `swipeActions`, separators and familiar system behaviour without code. A lazy stack gives full layout control: card designs, `pinnedViews` for sticky headers, view-aligned carousels and scroll-driven effects, but you build every interaction yourself, and you must check VoiceOver order, actions and Dynamic Type for each custom row. So the rule I would write: `List` for editable or system-like collections, a lazy stack for designed feeds, an exception process for anything else, and profiling before either is blamed for scrolling cost. iOS 27 narrows the gap by adding swipe actions and reordering outside `List`, but that matters only once the deployment target reaches iOS 27.

go deeper

for a junior

Recall that List adds system styling, selection, deletion and swipe actions, while a LazyVStack in a ScrollView gives layout control without those behaviours.

for a middle

Explain that both load rows lazily, list what each gives for free, and show which modifiers belong to List rows versus scroll views.

for a senior

Judge a concrete screen: required interactions, design constraints, accessibility verification and measured performance, and defend the container you pick.

for a principal

Own the standard and its exceptions, tie its revision to the deployment target reaching iOS 27, and track hitches and accessibility reports per container.

## What is actually being decided Every long screen in a SwiftUI app sits in one of two containers: **`List`**, or a **`LazyVStack` inside a `ScrollView`**. Left undecided, each engineer picks by habit, and the app ends up with feeds that swipe in one place and not another, separators that differ, and a different accessibility story per screen. A lead's job is to set the default and the reasons to deviate. Apple frames the relationship clearly: a `List` is "conceptually similar to the combination of a `LazyVStack` and `ScrollView`" but adds **platform-appropriate styling** and **interactivity** for inserting, reordering and removing items, and its rows "load lazily" too. So the choice is rarely about raw speed; it is about **what you get for free versus what you control**. ## What each container brings | Concern | `List` | `LazyVStack` in `ScrollView` | |---|---|---| | Lazy row creation | Yes | Yes | | Selection and edit mode | Built in | Build it yourself | | `onDelete`, `onMove` | Built in on `ForEach` | No system gesture; `reorderable()` with `reorderContainer` arrives in iOS 27 | | Swipe actions | `swipeActions` on rows | iOS 27 adds swipe actions in any container | | Separators, insets, row backgrounds | System, configurable with `listRow…` modifiers | Your own design | | Custom card layout, carousels inside rows | Fights the list styling | Natural | | Sticky headers with `pinnedViews` | Not a parameter; headers follow the list style | Available | | Accessibility of rows | System list conventions | You verify every custom row | ## A standard a team can apply 1. **Editable or system-like collections use `List`.** Inboxes, settings, saved items, anything with selection, multi-select, delete or reorder. Hand-building these in a stack costs code and risks accessibility regressions. 2. **Designed feeds use a lazy stack.** Card timelines, media feeds, screens with embedded carousels, sticky date headers or view-aligned paging. Layout control is the point, and you accept owning the interactions. 3. **Each custom feed row passes an accessibility check**: a sensible VoiceOver label and order, actions exposed for any gesture-only interaction, and layout that survives large Dynamic Type sizes. 4. **Performance claims need a profile.** Neither container is "the fast one" by default; measure with Instruments before migrating a screen. 5. **Write the exceptions down.** A feed that needs both editing and a bespoke design is a real case; record which container won and why. ## The deployment target moves the line The iOS 27 SDK adds swipe actions to views in containers such as scroll views, stacks, grids and custom layouts, through `swipeActions(edge:allowsFullSwipe:content:onPresentationChanged:)` and `swipeActionsContainer()`, and adds `reorderable()` with `reorderContainer` for stacks and layouts. That removes two of the strongest reasons to keep a designed feed in a `List`. But most apps still deploy to iOS 17 or 18, where those APIs do not exist, so: - record the iOS 27 features as a **trigger to revisit** the standard, not as today's rule; - avoid building a private swipe system now that you would replace once iOS 27 is the minimum. ## Rolling the standard out - Ship **two shared containers**, a list-based one and a lazy-stack feed, so screens start from the agreed default instead of a blank `ScrollView`. - Add the container question to the **review checklist**: which kind of collection is this, and does the choice match the rule? - Migrate existing screens **opportunistically**, when a screen is being redesigned anyway, not in a big-bang rewrite. ## Trade-offs to argue openly - **Consistency versus brand.** `List` makes the app feel native for free; a design team may want a look `List` resists. Decide per surface type, not per screen. - **Ownership cost.** Every interaction rebuilt in a stack is code to test, localise and make accessible. - **Migration cost.** Switching a mature screen's container changes row identity, layout and accessibility behaviour at once; do it with a reason, not a fashion. - **Signals to monitor.** Scroll hitches, memory in long sessions, and accessibility bug reports per container type tell you whether the standard holds.

  • A designer wants a card feed with swipe-to-archive, and the app supports iOS 17. What do you choose?
    Either a List styled toward the design with listStyle(.plain), listRowInsets, listRowSeparator and listRowBackground, keeping system swipe actions, or a lazy stack with archive offered through a context menu or an explicit button. I would not hand-build a swipe gesture system, because iOS 27's swipe actions outside List will replace it.
  • How would you prove that moving a screen from List to a lazy stack is worth it?
    Name the goal first, such as a layout List cannot express or measured hitches, then profile both versions on a real device with the SwiftUI template in Instruments, and run a VoiceOver and Dynamic Type pass on the new rows. If the gain is only aesthetic, weigh it against the interactions you now have to own.

  • List is slow because it builds every row up front, unlike a LazyVStack.
  • A LazyVStack gives you selection and swipe-to-delete for free.
  • On iOS 17, swipeActions on LazyVStack rows behave like List swipes.
  • Container choice is a per-engineer style preference with no product impact.

Assumes an iOS 17 or 18 deployment target; swipe actions outside List and reorderable() for stacks and layouts arrive with the iOS 27 SDK.