lists 

SwiftUI makes it really easy to build lists similar to a UIKit Table View if you have coded in UIKit before. Using a List you can display rows of data in a single column.

For example, you can display the list of cities in the world.

List {
    Text("New York City")
    Text("Portland")
    Text("Kansas City")
    Text("San Fransisco")
    Text("Bengaluru")
    Text("Madrid")
}

You can even categorize cities in their respective countries using a Section container to give our list some hierarchy.

Let’s add some more cities and categorize them under the country they belong to.

List {
    Section("USA") {
        Text("New York City")
        Text("Portland")
        Text("Kansas City")
        Text("San Francisco")
    }

    Section("India") {
        Text("Bengaluru")
        Text("Pune")
        Text("Mumbai")
    }

    Section("Spain") {
        Text("Barcelona")
        Text("Madrid")
    }
}