Required Instance Methodswift 6.0.1Swift

    decode(_:forKey:)

    Decodes a value of the given type for the given key.

    func decode(_ type: UInt16.Type, forKey key: Self.Key) throws -> UInt16

    Parameters

    type

    The type of value to decode.

    key

    The key that the decoded value is associated with.

    Returns

    A value of the requested type, if present for the given key and convertible to the requested type.

    Throws

    DecodingError.typeMismatch if the encountered encoded value is not convertible to the requested type.

    DecodingError.keyNotFound if self does not have an entry for the given key.

    DecodingError.valueNotFound if self has a null entry for the given key.

    Other requirements

    View members

    Hide members

    This section is hidden by default because it contains too many (42) members.

    Type members

    Instance members

    Citizens in Swift

    Default implementations