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
valueThe value to encode.
encoderThe encoder to write data to.
Discussion
This method throws an error if writing to the encoder fails.
Default Implementations
EncodableAttributedStringKey Implementations
static func encode(Self.Value, to: any Encoder) throwsEncodes a Swift value to the provided encoder, using a default implementation.