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 : ClassFamily

    Parameters

    family

    The ClassFamily enum for the type family.

    key

    The CodingKey to look up the list in the current container.

    Return Value

    The resulting list of heterogeneousType elements.