I would like to parse/decode a JSON string and then create a dynamic list.
Example JSON:
[{"course":"course1","teacher":"teacherName1"},{"course":"course1","teacher":"teacherName2"}]
My wish:
List {
HStack {
Text("course1")
Spacer()
Text("teacherName1")
}
HStack {
Text("course2")
Spacer()
Text("teacherName2")
}
}
I've tried it with JSONDecoder() and arrays but Xcode marks my TabView over and over with this message: Cannot convert value of type 'Binding<Int>' to expected argument type 'Binding<_>?'
I'm new to swift, sorry ;)