Initializer

init(from:)

Creates a new set by decoding from the given decoder.

Declaration

init(from decoder: Decoder) throws
Available when Element conforms to Decodable.

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.

Relationships

From Protocol

See Also

Encoding and Decoding

func encode(to: Encoder)

Encodes the elements of this set into the given encoder in an unkeyed container.