Answers for "swiftui list with sections and headers"

0

list header swiftui

struct MyHeader: View {
    var body: some View {
        Text("Header")
    }
}

struct DemoTableHeader: View {
    let myList: [String] = ["1", "2", "3"]

    var body: some View {
        List {
            MyHeader()
            ForEach(myList, id: \.self) { element in
                Text(element)
            }
        }
    }
}
Posted by: Guest on January-20-2021

Code answers related to "Swift"

Browse Popular Code Answers by Language