© The Author(s), under exclusive license to APress Media, LLC, part of Springer Nature 2022
W. WangBeginning iPhone Development with SwiftUIhttps://doi.org/10.1007/978-1-4842-7818-5_13

13. Displaying Lists

Wally Wang1  
(1)
San Diego, CA, USA
 
One common way to display lots of related data to the user is through a List (also called a table view). A List simply shows multiple rows of similar types of data stacked vertically. The simplest type of a List defines one or more Text views that appear in separate rows as shown in Figure 13-1:
        List {
            Text("Cat")
            Text("Dog")
            Text("Bird")
            Text("Reptile")
            Text("Fish")
        }
Figure 13-1

A simple List containing multiple Text views

If a List contains ...

Get Beginning iPhone Development with SwiftUI: Exploring the iOS SDK now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.