Skip to content

Type MethodFoundationEssentials

decodeMarkdown(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, using a default implementation.
static func decodeMarkdown(from decoder: any Decoder) throws -> Self.Value

Parameters

decoder

The decoder to read data from.

Return Value

The decoded value.

Discussion

The default implementation calls DecodableAttributedStringKey/decode(from:)-9mpts, inherited from DecodableAttributedStringKey, meaning it uses the same decoding as non-Markdown encoding.

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