【发布时间】:2019-12-14 09:34:08
【问题描述】:
我有以下简单的 JSON:
{
"201" :
{
"countryName" : "Albania",
"countryCode" : "AL"
},
"202" :
{
"countryName" : "Andorra",
"countryCode" : "AD"
},
...
}
内部字典简单地变成:
struct Mid : Codable
{
var countryName: String
var countryCode: String
}
但后来我被困住了。如何表示外部字典?
我想最终得到一个带有String 键"201"、"202"、...的Mid 对象字典。
【问题讨论】:
标签: ios swift dictionary codable