Skip to main content

Working with lists

About 2 minSwiftSwiftUIArticle(s)bloghackingwithswift.comcrashcourseswiftswiftuixcodeappstore

Working with lists 관련

SwiftUI by Example

Back to Home

Working with lists | SwiftUI by Example

Working with lists

Updated for Xcode 15

SwiftUI's List view is similar to UITableView in that it can show static or dynamic table view cells based on your needs. However, it is significantly simpler to use: we don't need to create prototype cells in storyboards, or register them in code; we don't need to tell it how many rows there are; we don't need to dequeue and configure cells by hand, and more.

Instead, SwiftUI's lists are designed for composability – designed to be able to build bigger things from smaller things. So, rather than having one large view controller that configures cells by hand, SwiftUI has us build small views that know how to configure themselves as list rows, then uses those.

In terms of code size if nothing else, the difference is staggering – you can delete almost all your table view code and still get the same great look and feel you're used to.

Similar solutions…
How to create multi-column lists using Table | SwiftUI by Example

How to create multi-column lists using Table
How to get translucent lists on macOS | SwiftUI by Example

How to get translucent lists on macOS
How to create grouped and inset grouped lists | SwiftUI by Example

How to create grouped and inset grouped lists
How to create expanding lists | SwiftUI by Example

How to create expanding lists
How to make carousel lists on watchOS | SwiftUI by Example

How to make carousel lists on watchOS

이찬희 (MarkiiimarK)
Never Stop Learning.