【发布时间】:2021-03-30 11:44:51
【问题描述】:
我得到了一个类似下面的结构
struct Wrapper {
var value: [String: Any]
// type "Any" could be String, Int or [String].
// i.g. ["a": 1, "b": ["ccc"]]
// and the keys of this dictionary are not determined
}
我挣扎了好久???? 有人知道如何解决吗?
【问题讨论】:
-
你可以使用枚举类型而不是 Any 但我认为这样的小姐 json 需要一个通常的序列化而不是编码