KeyedDecodingContainer
extension KeyedDecodingContainer
-
Decode a heterogeneous list of objects for a given family.
Declaration
Swift
func decode<T, U>(family: U.Type, forKey key: K) throws -> [T] where T : Decodable, U : ClassFamilyParameters
familyThe ClassFamily enum for the type family.
keyThe CodingKey to look up the list in the current container.
Return Value
The resulting list of heterogeneousType elements.
KeyedDecodingContainer Extension Reference