Skip to content

Type Method

encode(_:to:)

iOS 15.0+ iPadOS 15.0+ Mac Catalyst 15.0+ macOS 12.0+ tvOS 15.0+ watchOS 8.0+
Encodes a value to the provided encoder.
static func encode(_ value: Self.Value, to encoder: any Encoder) throws

Parameters

value

The value to encode.

encoder

The encoder to write data to.

Discussion

This method throws an error if writing to the encoder fails.

Default Implementations

EncodableAttributedStringKey Implementations