Required Instance Methodswift 6.0.3Swift

decode(_:)

Decodes a single value of the given type.

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

Parameters

type

The type to decode as.

Returns

A value of the requested type.

Throws

DecodingError.typeMismatch if the encountered encoded value cannot be converted to the requested type.

DecodingError.valueNotFound if the encountered encoded value is null.