我有一个实现Swift 4的结构Codable.是否有一种简单的内置方法将该结构编码为字典?
Codable
let struct = Foo(a: 1, b: 2) let dict = something(struct) // now dict is ["a": 1, "b": 2]
swift swift4 codable
codable ×1
swift ×1
swift4 ×1