Daily iOS
SwiftUI

List scrolling diagnosis

You got a report that a SwiftUI List stutters while scrolling, and that row toggles and images change to the wrong ones or flicker. In what order do you suspect causes, and what do you fix them with?

How would an interviewer hear this answer? You'll see whether they'd move on, dig in, or say no, and which sentences would trip you up. Your score doesn't change.
See the short answer

Rows getting mixed up is usually an unstable id (an index, or a UUID created in body every time), and stuttering is heavy computation in row bodies or a structure where one item's change re-evaluates the whole list body. Fix with stable Identifiable ids, per-row state separation, and caching images and formatters.

Share a question