I tried to replicate the code but I am not able to traverse the my data.
I am getting error "Value of type 'Data' has no member 'children'" . I even tried values instead of children but I am getting "Key path value type '[String]' cannot be converted to contextual type '[Data]?'"
Please let me know how to use \.children and outline group.
Code Block import SwiftUI struct ContentView: View { let testData: [Data] var body: some View { List(testData, children: \.children) { value in Text(value.values) } } } struct ContentView_Previews: PreviewProvider { static var previews: some View { ContentView(testData: testData) } } let testData = [Data(), Data()] struct Data: Identifiable { let id = UUID() let values: [String] = ["One", "Two", "Three"] }
I am getting error "Value of type 'Data' has no member 'children'" . I even tried values instead of children but I am getting "Key path value type '[String]' cannot be converted to contextual type '[Data]?'"
Please let me know how to use \.children and outline group.