KeyedDecodingContainer
extension KeyedDecodingContainer
extending KeyedDecodingContainer
so it will only decode an optional value if it is present
-
Declaration
Swift
public func decode<T>(_ type: T.Type, forKey key: KeyedDecodingContainer<K>.Key) throws -> T where T : OptionalCustomCodingWrapper, T : Decodable