KeyedDecodingContainer
public extension KeyedDecodingContainer
-
Default implementation of decoding a DefaultCodable
Decodes successfully if key is available if not fallsback to the default value provided.
Declaration
Swift
func decode<P>(_: DefaultCodable<P>.Type, forKey key: Key) throws -> DefaultCodable<P> where P : DefaultCodableStrategy
-
Default implementation of decoding a
DefaultCodable
where its strategy is aBoolCodableStrategy
.Tries to initially Decode a
Bool
if available, otherwise tries to decode it as anInt
orString
when there is atypeMismatch
decoding error. This preserves the actual value of theBool
in which the data provider might be sending the value as different types. If everything fails defaults to thedefaultValue
provided by the strategy.Declaration
Swift
func decode<P>(_: DefaultCodable<P>.Type, forKey key: Key) throws -> DefaultCodable<P> where P : BoolCodableStrategy
-
Undocumented
Declaration
Swift
public func decode(_ type: OptionalISO8601.Type, forKey key: `Self`.Key) throws -> OptionalISO8601
-
Undocumented
Declaration
Swift
public func decode(_ type: OptionalISO8601OrSecondsSince1970.Type, forKey key: `Self`.Key) throws -> OptionalISO8601OrSecondsSince1970