How can I read in a json file that has a list in it

Ok so I am a beginner and I'm trying to understand SwiftUI and building apps. When I was reading a JSON file that was formatted as such:

[
{
"id":01,
"name":"name1"
}
etc. etc.
]

I was doing fine as I was trying to repeat a view for each entry in the JSON file. However, I now have a JSON file that has a list in it as such :
[
{
"id":01,
"names":["name1","name2","name3","name4"],
}
etc. etc.
]

and now I am having trouble getting each of those names in order to create a Button for each name in that list. I dont know if that makes a lot of sense. I am Using SwiftUI and XCode 11 Beta 3 If that Helps. Thank you for the help.

Did you try ForEach? See https://developer.apple.com/documentation/swiftui/foreach

Or do you have another problem, what exactly do you mean by

Terms of Service

Privacy Policy

Cookie Policy