Protocol
DecodableAttributedStringKey
iOS 15.0+
iPadOS 15.0+
Mac Catalyst 15.0+
macOS 12.0+
tvOS 15.0+
watchOS 8.0+
A protocol that defines how an attribute key decodes its value.
protocol DecodableAttributedStringKey : AttributedStringKey
Overview
Implement this protocol to make an attribute decodable. Decoding an AttributedString or AttributeContainer drops any attributes whose types don’t conform to this protocol.
Topics
Type Methods
static func decode(from: any Decoder) throws -> Self.ValueDecodes a value from the provided decoder.
Relationships
Inherits From
AttributedStringKeySwift.SendableMetatype
Conforming Types
AttributeScopes.FoundationAttributes.AlternateDescriptionAttributeAttributeScopes.FoundationAttributes.ByteCountAttributeAttributeScopes.FoundationAttributes.DateFieldAttributeAttributeScopes.FoundationAttributes.DurationFieldAttributeAttributeScopes.FoundationAttributes.ImageURLAttributeAttributeScopes.FoundationAttributes.LanguageIdentifierAttributeAttributeScopes.FoundationAttributes.LinkAttributeAttributeScopes.FoundationAttributes.MeasurementAttributeAttributeScopes.FoundationAttributes.NumberFormatAttributes.NumberPartAttributeAttributeScopes.FoundationAttributes.NumberFormatAttributes.SymbolAttributeAttributeScopes.FoundationAttributes.PersonNameComponentAttributeAttributeScopes.FoundationAttributes.ReplacementIndexAttributeAttributeScopes.FoundationAttributes.WritingDirectionAttribute