Skip to content

Type Method

decode(from:)

iOS 15.0+ iPadOS 15.0+ Mac Catalyst 15.0+ macOS 12.0+ tvOS 15.0+ watchOS 8.0+
Decodes a value from the provided decoder.
static func decode(from decoder: any Decoder) throws -> Self.Value

Parameters

decoder

The decoder to read data from.

Return Value

The decoded value.

Discussion

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

Default Implementations

DecodableAttributedStringKey Implementations