In the root object (finalResult
) iterate the array rankings
let finalResult = try JSONDecoder().decode(Result2.self, from: data!)
for myRanking in finalResult.rankings {
print(myRanking.ranking)
}
1
solved unable to extract value from struct using swift JSON Decoder