Swift with Majid
Read post

Building List replacement in SwiftUI

When building scrollable screens in SwiftUI, List is not always the best choice for non-uniform data. Using ScrollView with lazy stacks and the Container View APIs introduced in recent SwiftUI versions, you can build custom reusable primitives that offer more design flexibility. The post walks through building ScrollingSurface (a ScrollView/LazyStack wrapper), DividedCard (using Group(subviews:) to insert dividers between child views), and SectionedSurface (using ForEach(sections:) to extract and filter sections). A custom NavigationButtonStyle replicates the chevron indicator normally provided by List. Together these primitives replicate List behavior while giving precise control over look and feel.

    #ios#swift#swiftui
Apr 06•6m read time•From swiftwithmajid.com
Post cover image
420 Impressions
Swift with Majid's image
Swift with Majid

SwiftWithMajid is a platform for learning and mastering Swift programming, offering tutorials, artic...

67 Followers

•

119 Upvotes

Would you recommend this post?

Copy link
WhatsApp
Facebook
X
New Squad
  • © 2026 Daily Dev Ltd.
  • Guidelines
  • Explore
  • Tags
  • Sources
  • Squads
  • Leaderboard