Required Instance Methodswift 6.0.3Swift

decode(_:)

Decodes a value of the given type.

mutating func decode(_ type: Int16.Type) throws -> Int16

Parameters

type

The type of value to decode.

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.valueNotFound if the encountered encoded value is null, or of there are no more values to decode.