---
title: DecodableAttributedStringKey
framework: foundation
role: symbol
role_heading: Protocol
path: foundation/decodableattributedstringkey
---

# DecodableAttributedStringKey

A protocol that defines how an attribute key decodes its value.

## Declaration

```swift
protocol DecodableAttributedStringKey : AttributedStringKey
```

## Overview

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

### Decoding Values

- [decode(from:)](foundation/decodableattributedstringkey/decode(from:).md)

## Relationships

### Inherits From

- [AttributedStringKey](foundation/attributedstringkey.md)
- [SendableMetatype](swift/sendablemetatype.md)

### Conforming Types

- [AttributeScopes.AccessibilityAttributes.AdjustedPitchAttribute](foundation/attributescopes/accessibilityattributes/adjustedpitchattribute.md)
- [AttributeScopes.AccessibilityAttributes.AnnouncementPriorityAttribute](foundation/attributescopes/accessibilityattributes/announcementpriorityattribute.md)
- [AttributeScopes.AccessibilityAttributes.HeadingLevelAttribute](foundation/attributescopes/accessibilityattributes/headinglevelattribute.md)
- [AttributeScopes.AccessibilityAttributes.IPANotationAttribute](foundation/attributescopes/accessibilityattributes/ipanotationattribute.md)
- [AttributeScopes.AccessibilityAttributes.IncludesPunctuationAttribute](foundation/attributescopes/accessibilityattributes/includespunctuationattribute.md)
- [AttributeScopes.AccessibilityAttributes.QueueAnnouncementAttribute](foundation/attributescopes/accessibilityattributes/queueannouncementattribute.md)
- [AttributeScopes.AccessibilityAttributes.SpellOutAttribute](foundation/attributescopes/accessibilityattributes/spelloutattribute.md)
- [AttributeScopes.AccessibilityAttributes.TextCustomAttribute](foundation/attributescopes/accessibilityattributes/textcustomattribute.md)
- [AttributeScopes.AccessibilityAttributes.TextualContextAttribute](foundation/attributescopes/accessibilityattributes/textualcontextattribute.md)
- [AttributeScopes.AppKitAttributes.AdaptiveImageGlyphAttribute](foundation/attributescopes/appkitattributes/adaptiveimageglyphattribute.md)
- [AttributeScopes.AppKitAttributes.AttachmentAttribute](foundation/attributescopes/appkitattributes/attachmentattribute.md)
- [AttributeScopes.AppKitAttributes.BackgroundColorAttribute](foundation/attributescopes/appkitattributes/backgroundcolorattribute.md)
- [AttributeScopes.AppKitAttributes.BaselineOffsetAttribute](foundation/attributescopes/appkitattributes/baselineoffsetattribute.md)
- [AttributeScopes.AppKitAttributes.ExpansionAttribute](foundation/attributescopes/appkitattributes/expansionattribute.md)
- [AttributeScopes.AppKitAttributes.FontAttribute](foundation/attributescopes/appkitattributes/fontattribute.md)
- [AttributeScopes.AppKitAttributes.ForegroundColorAttribute](foundation/attributescopes/appkitattributes/foregroundcolorattribute.md)
- [AttributeScopes.AppKitAttributes.GlyphInfoAttribute](foundation/attributescopes/appkitattributes/glyphinfoattribute.md)
- [AttributeScopes.AppKitAttributes.KernAttribute](foundation/attributescopes/appkitattributes/kernattribute.md)
- [AttributeScopes.AppKitAttributes.LigatureAttribute](foundation/attributescopes/appkitattributes/ligatureattribute.md)
- [AttributeScopes.AppKitAttributes.MarkedClauseSegmentAttribute](foundation/attributescopes/appkitattributes/markedclausesegmentattribute.md)
- [AttributeScopes.AppKitAttributes.ObliquenessAttribute](foundation/attributescopes/appkitattributes/obliquenessattribute.md)
- [AttributeScopes.AppKitAttributes.ParagraphStyleAttribute](foundation/attributescopes/appkitattributes/paragraphstyleattribute.md)
- [AttributeScopes.AppKitAttributes.ShadowAttribute](foundation/attributescopes/appkitattributes/shadowattribute.md)
- [AttributeScopes.AppKitAttributes.StrikethroughColorAttribute](foundation/attributescopes/appkitattributes/strikethroughcolorattribute.md)
- [AttributeScopes.AppKitAttributes.StrikethroughStyleAttribute](foundation/attributescopes/appkitattributes/strikethroughstyleattribute.md)
- [AttributeScopes.AppKitAttributes.StrokeColorAttribute](foundation/attributescopes/appkitattributes/strokecolorattribute.md)
- [AttributeScopes.AppKitAttributes.StrokeWidthAttribute](foundation/attributescopes/appkitattributes/strokewidthattribute.md)
- [AttributeScopes.AppKitAttributes.SuperscriptAttribute](foundation/attributescopes/appkitattributes/superscriptattribute.md)
- [AttributeScopes.AppKitAttributes.TextAlternativesAttribute](foundation/attributescopes/appkitattributes/textalternativesattribute.md)
- [AttributeScopes.AppKitAttributes.TextEffectAttribute](foundation/attributescopes/appkitattributes/texteffectattribute.md)
- [AttributeScopes.AppKitAttributes.ToolTipAttribute](foundation/attributescopes/appkitattributes/tooltipattribute.md)
- [AttributeScopes.AppKitAttributes.TrackingAttribute](foundation/attributescopes/appkitattributes/trackingattribute.md)
- [AttributeScopes.AppKitAttributes.UnderlineColorAttribute](foundation/attributescopes/appkitattributes/underlinecolorattribute.md)
- [AttributeScopes.AppKitAttributes.UnderlineStyleAttribute](foundation/attributescopes/appkitattributes/underlinestyleattribute.md)
- [AttributeScopes.CoreTextAttributes.TextAlignmentAttribute](foundation/attributescopes/coretextattributes/textalignmentattribute.md)
- [AttributeScopes.FoundationAttributes.AgreementArgumentAttribute](foundation/attributescopes/foundationattributes/agreementargumentattribute.md)
- [AttributeScopes.FoundationAttributes.AgreementConceptAttribute](foundation/attributescopes/foundationattributes/agreementconceptattribute.md)
- [AttributeScopes.FoundationAttributes.AlternateDescriptionAttribute](foundation/attributescopes/foundationattributes/alternatedescriptionattribute.md)
- [AttributeScopes.FoundationAttributes.ByteCountAttribute](foundation/attributescopes/foundationattributes/bytecountattribute.md)
- [AttributeScopes.FoundationAttributes.DateFieldAttribute](foundation/attributescopes/foundationattributes/datefieldattribute.md)
- [AttributeScopes.FoundationAttributes.DurationFieldAttribute](foundation/attributescopes/foundationattributes/durationfieldattribute.md)
- [AttributeScopes.FoundationAttributes.ImageURLAttribute](foundation/attributescopes/foundationattributes/imageurlattribute.md)
- [AttributeScopes.FoundationAttributes.InflectionAlternativeAttribute](foundation/attributescopes/foundationattributes/inflectionalternativeattribute.md)
- [AttributeScopes.FoundationAttributes.InflectionRuleAttribute](foundation/attributescopes/foundationattributes/inflectionruleattribute.md)
- [AttributeScopes.FoundationAttributes.InlinePresentationIntentAttribute](foundation/attributescopes/foundationattributes/inlinepresentationintentattribute.md)
- [AttributeScopes.FoundationAttributes.LanguageIdentifierAttribute](foundation/attributescopes/foundationattributes/languageidentifierattribute.md)
- [AttributeScopes.FoundationAttributes.LinkAttribute](foundation/attributescopes/foundationattributes/linkattribute.md)
- [AttributeScopes.FoundationAttributes.ListItemDelimiterAttribute](foundation/attributescopes/foundationattributes/listitemdelimiterattribute.md)
- [AttributeScopes.FoundationAttributes.LocalizedNumberFormatAttribute](foundation/attributescopes/foundationattributes/localizednumberformatattribute.md)
- [AttributeScopes.FoundationAttributes.LocalizedStringArgumentAttributes.LocalizedDateArgumentAttribute](foundation/attributescopes/foundationattributes/localizedstringargumentattributes-swift.struct/localizeddateargumentattribute.md)
- [AttributeScopes.FoundationAttributes.LocalizedStringArgumentAttributes.LocalizedDateIntervalArgumentAttribute](foundation/attributescopes/foundationattributes/localizedstringargumentattributes-swift.struct/localizeddateintervalargumentattribute.md)
- [AttributeScopes.FoundationAttributes.LocalizedStringArgumentAttributes.LocalizedNumericArgumentAttribute](foundation/attributescopes/foundationattributes/localizedstringargumentattributes-swift.struct/localizednumericargumentattribute.md)
- [AttributeScopes.FoundationAttributes.LocalizedStringArgumentAttributes.LocalizedURLArgumentAttribute](foundation/attributescopes/foundationattributes/localizedstringargumentattributes-swift.struct/localizedurlargumentattribute.md)
- [AttributeScopes.FoundationAttributes.MarkdownSourcePositionAttribute](foundation/attributescopes/foundationattributes/markdownsourcepositionattribute.md)
- [AttributeScopes.FoundationAttributes.MeasurementAttribute](foundation/attributescopes/foundationattributes/measurementattribute.md)
- [AttributeScopes.FoundationAttributes.MorphologyAttribute](foundation/attributescopes/foundationattributes/morphologyattribute.md)
- [AttributeScopes.FoundationAttributes.NumberFormatAttributes.NumberPartAttribute](foundation/attributescopes/foundationattributes/numberformatattributes/numberpartattribute.md)
- [AttributeScopes.FoundationAttributes.NumberFormatAttributes.SymbolAttribute](foundation/attributescopes/foundationattributes/numberformatattributes/symbolattribute.md)
- [AttributeScopes.FoundationAttributes.PersonNameComponentAttribute](foundation/attributescopes/foundationattributes/personnamecomponentattribute.md)
- [AttributeScopes.FoundationAttributes.PresentationIntentAttribute](foundation/attributescopes/foundationattributes/presentationintentattribute.md)
- [AttributeScopes.FoundationAttributes.ReferentConceptAttribute](foundation/attributescopes/foundationattributes/referentconceptattribute.md)
- [AttributeScopes.FoundationAttributes.ReplacementIndexAttribute](foundation/attributescopes/foundationattributes/replacementindexattribute.md)
- [AttributeScopes.FoundationAttributes.WritingDirectionAttribute](foundation/attributescopes/foundationattributes/writingdirectionattribute.md)
- [AttributeScopes.SpeechAttributes.ConfidenceAttribute](foundation/attributescopes/speechattributes/confidenceattribute.md)
- [AttributeScopes.SpeechAttributes.TimeRangeAttribute](foundation/attributescopes/speechattributes/timerangeattribute.md)
- [AttributeScopes.SwiftUIAttributes.AdaptiveImageGlyphAttribute](foundation/attributescopes/swiftuiattributes/adaptiveimageglyphattribute.md)
- [AttributeScopes.SwiftUIAttributes.BackgroundColorAttribute](foundation/attributescopes/swiftuiattributes/backgroundcolorattribute.md)
- [AttributeScopes.SwiftUIAttributes.BaselineOffsetAttribute](foundation/attributescopes/swiftuiattributes/baselineoffsetattribute.md)
- [AttributeScopes.SwiftUIAttributes.FontAttribute](foundation/attributescopes/swiftuiattributes/fontattribute.md)
- [AttributeScopes.SwiftUIAttributes.ForegroundColorAttribute](foundation/attributescopes/swiftuiattributes/foregroundcolorattribute.md)
- [AttributeScopes.SwiftUIAttributes.KerningAttribute](foundation/attributescopes/swiftuiattributes/kerningattribute.md)
- [AttributeScopes.SwiftUIAttributes.StrikethroughStyleAttribute](foundation/attributescopes/swiftuiattributes/strikethroughstyleattribute.md)
- [AttributeScopes.SwiftUIAttributes.TrackingAttribute](foundation/attributescopes/swiftuiattributes/trackingattribute.md)
- [AttributeScopes.SwiftUIAttributes.UnderlineStyleAttribute](foundation/attributescopes/swiftuiattributes/underlinestyleattribute.md)
- [AttributeScopes.UIKitAttributes.AdaptiveImageGlyphAttribute](foundation/attributescopes/uikitattributes/adaptiveimageglyphattribute.md)
- [AttributeScopes.UIKitAttributes.AttachmentAttribute](foundation/attributescopes/uikitattributes/attachmentattribute.md)
- [AttributeScopes.UIKitAttributes.BackgroundColorAttribute](foundation/attributescopes/uikitattributes/backgroundcolorattribute.md)
- [AttributeScopes.UIKitAttributes.BaselineOffsetAttribute](foundation/attributescopes/uikitattributes/baselineoffsetattribute.md)
- [AttributeScopes.UIKitAttributes.ExpansionAttribute](foundation/attributescopes/uikitattributes/expansionattribute.md)
- [AttributeScopes.UIKitAttributes.FontAttribute](foundation/attributescopes/uikitattributes/fontattribute.md)
- [AttributeScopes.UIKitAttributes.ForegroundColorAttribute](foundation/attributescopes/uikitattributes/foregroundcolorattribute.md)
- [AttributeScopes.UIKitAttributes.KernAttribute](foundation/attributescopes/uikitattributes/kernattribute.md)
- [AttributeScopes.UIKitAttributes.LigatureAttribute](foundation/attributescopes/uikitattributes/ligatureattribute.md)
- [AttributeScopes.UIKitAttributes.ObliquenessAttribute](foundation/attributescopes/uikitattributes/obliquenessattribute.md)
- [AttributeScopes.UIKitAttributes.ParagraphStyleAttribute](foundation/attributescopes/uikitattributes/paragraphstyleattribute.md)
- [AttributeScopes.UIKitAttributes.ShadowAttribute](foundation/attributescopes/uikitattributes/shadowattribute.md)
- [AttributeScopes.UIKitAttributes.StrikethroughColorAttribute](foundation/attributescopes/uikitattributes/strikethroughcolorattribute.md)
- [AttributeScopes.UIKitAttributes.StrikethroughStyleAttribute](foundation/attributescopes/uikitattributes/strikethroughstyleattribute.md)
- [AttributeScopes.UIKitAttributes.StrokeColorAttribute](foundation/attributescopes/uikitattributes/strokecolorattribute.md)
- [AttributeScopes.UIKitAttributes.StrokeWidthAttribute](foundation/attributescopes/uikitattributes/strokewidthattribute.md)
- [AttributeScopes.UIKitAttributes.TextEffectAttribute](foundation/attributescopes/uikitattributes/texteffectattribute.md)
- [AttributeScopes.UIKitAttributes.TextItemTagAttribute](foundation/attributescopes/uikitattributes/textitemtagattribute.md)
- [AttributeScopes.UIKitAttributes.TrackingAttribute](foundation/attributescopes/uikitattributes/trackingattribute.md)
- [AttributeScopes.UIKitAttributes.UnderlineColorAttribute](foundation/attributescopes/uikitattributes/underlinecolorattribute.md)
- [AttributeScopes.UIKitAttributes.UnderlineStyleAttribute](foundation/attributescopes/uikitattributes/underlinestyleattribute.md)

## See Also

### Encoding and Decoding Keys

- [EncodableAttributedStringKey](foundation/encodableattributedstringkey.md)
- [CodableAttributedStringKey](foundation/codableattributedstringkey.md)
