Protocol
EncodableAttributedStringKey
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 encodes its value.
protocol EncodableAttributedStringKey : AttributedStringKey
Overview
Implement this protocol to make an attribute encodable. Encoding an AttributedString or AttributeContainer drops any attributes whose types don’t conform to this protocol.
Topics
Type Methods
static func encode(Self.Value, to: any Encoder) throwsEncodes a value to the provided encoder.
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