Initializer

init(from:)

Creates a new instance by decoding from the given decoder, when the type’s RawValue is Int.

Declaration

init(from decoder: Decoder) throws
Available when Self conforms to Decodable and RawValue is Int.

Parameters

decoder

The decoder to read data from.

Discussion

This initializer throws an error if reading from the decoder fails, or if the data read is corrupted or otherwise invalid.

See Also

Decoding a Value

init(from: Decoder)

Creates a new instance by decoding from the given decoder, when the type’s RawValue is String.

init(from: Decoder)

Creates a new instance by decoding from the given decoder, when the type’s RawValue is Bool.

init(from: Decoder)

Creates a new instance by decoding from the given decoder, when the type’s RawValue is Double.

init(from: Decoder)

Creates a new instance by decoding from the given decoder, when the type’s RawValue is Float.

init(from: Decoder)

Creates a new instance by decoding from the given decoder, when the type’s RawValue is UInt.

init(from: Decoder)

Creates a new instance by decoding from the given decoder, when the type’s RawValue is Int8.

init(from: Decoder)

Creates a new instance by decoding from the given decoder, when the type’s RawValue is Int16.

init(from: Decoder)

Creates a new instance by decoding from the given decoder, when the type’s RawValue is Int32.

init(from: Decoder)

Creates a new instance by decoding from the given decoder, when the type’s RawValue is Int64.

init(from: Decoder)

Creates a new instance by decoding from the given decoder, when the type’s RawValue is UInt8.

init(from: Decoder)

Creates a new instance by decoding from the given decoder, when the type’s RawValue is UInt16.

init(from: Decoder)

Creates a new instance by decoding from the given decoder, when the type’s RawValue is UInt32.

init(from: Decoder)

Creates a new instance by decoding from the given decoder, when the type’s RawValue is UInt64.