I have an array of dictionaries. However I want to display a specific key from the dictionary to a text. But I keep getting the error "Instance method 'appendInterpolation(_:formatter:)' requires that 'Any' inherit from 'NSObject'"
Here is my dictionary
[
["nickname":"Spurs","Pts":21],
["nickname":"Liverpool","Pts":20]
]
Here is the code to print out the array
struct TeamList: View {
var clubRanking: [[String:Any]] = [["nickname":"Spurs","Pts":21],["nickname":"Liverpool","Pts":20]]
var body: some View {
VStack(alignment: .leading) {
Text("\(clubRanking[0]["nickname"])") //The error happens here
}
}
}
struct TeamList_Previews: PreviewProvider {
static var previews: some View {
TeamList()
}
}