【发布时间】:2018-05-26 13:32:31
【问题描述】:
请告诉我如何提取“排名”的值。首先检查图像。
我的结构:
struct Result2 : Codable{
let rankings : [Myrankings3]
struct Myrankings3 : Codable{
let ranking : String
}
}
JSON 代码
do {
let finalResult = try JSONDecoder().decode(Result2.self, from: data!)
print(finalResult)
// I want to get the value of ranking which is of type string
}
【问题讨论】:
-
欢迎来到 Stackoverflow。请不要张贴图片。将 JSON 作为文本发布。
-
我是新来的。感谢您的建议。但是告诉我如何在给定的结构中获得“排名”的值