int(0)
Next Previous

SwiftUI List

List element in SwiftUI is an equivalent to UITableView in UIKit.

Static List

To create a static List, create List() element with a closure.

Add a few Text() elements in it.

import SwiftUI
struct ContentView: View {
    var body: some View {
         List() {
            Text("Cell 01")
            Text("Cell 02")
            Text("Cell 03")
        }
    }
}

Dynamic List

import SwiftUI

struct ContentView: View {
    var body: some View {
        List(0..<10) {_ in
            Text("")
        }
    }
}

This will show the empty cells on the List.

Next Previous

Join Over 1000 🔥

Hey, Like What You're Reading?

JOIN to learn more about SwiftUI


Valid 9th - 14th Jul 2020
85% OFF

Vue.js & Google Maps API: Build Location-Based Web Apps Like A Pro!

🔥 1086+ students enrolled!
4.85 ⭐️⭐️⭐️⭐️⭐️ (31+ ratings)

BEST SELLER