extension KeyedEncodingContainer {
mutating func encode<T>(_ value: Default<T>, forKey key: Key) throws where T : DefaultValue {
try encodeIfPresent(value.wrappedValue, forKey: key)
}
}
Swift - Codable 解码设置默认值掘金同步更新:https://juejin.cn/user/3378158048121326/posts[https://juejin.cn/user/33781580481...