I got this JSON:
{
cover = {
id = 1;
};
description = "Test"
place = {
id = 11;
location = {
city = Wheatley;
};
name = "Wheatley Provincial Park";
};
},
{
cover = {
id = 2;
};
description = "Cool"
place = {
id = 22;
location = {
city = Wheatley;
};
name = "Wheatley Provincial Park";
};
}
This is my code:
if let fbData = result as? [String : Any] {
print(fbData)
for events in fbData {
print (events["name"] as! String)
//this displays an error
//Type (Key: String, value: Any) has subscript members
}
}
But I don't know how to loop through them
I already tried these solutions but they never worked: