NSAttributedString.Key
The attributes you apply to ranges of characters in an attributed string.
Declaration
struct KeyDiscussion
The NSAttributedString.Key type defines the attributes you apply to ranges of characters in an attributed string. Some attributes provide information about how to render, lay out, or interpret the text, while other attributes provide transient or collaborative information. Attributes like the font, kern, and strokeColor contain information that the rendering system uses to display the text. Attributes like the spellingState, textHighlightStyle, or accessibilityCustomText contain semantic information from other parts of the system. Some of these semantic attributes also affect how the system renders the text, but they are transient attributes unlike the core rendering attributes.
Topics
Getting rendering attribute keys
backgroundColorbaselineOffsetfontforegroundColorglyphInfokernligatureparagraphStylestrikethroughColorstrikethroughStylestrokeColorstrokeWidthsuperscripttrackingunderlineColorunderlineStylewritingDirection
Getting text attribute keys
cursorlinkmarkedClauseSegmentreplacementIndexshadowspellingStatesuggestionHighlighttextAlternativestextEffecttextHighlightColorSchemetextHighlightStyletextItemTagtoolTip
Getting attachment attribute keys
Getting accessibility attribute keys
accessibilityAlignmentaccessibilityAnnotationTextAttributeaccessibilityAttachmentaccessibilityAutocorrectedaccessibilityBackgroundColoraccessibilityCustomTextaccessibilityFontaccessibilityFontBoldAttributeaccessibilityFontItalicAttributeaccessibilityForegroundColoraccessibilityLanguageaccessibilityLinkaccessibilityListItemIndexaccessibilityListItemLevelaccessibilityListItemPrefixaccessibilityMarkedMisspelledaccessibilityMisspelledaccessibilityShadowaccessibilitySpeechAnnouncementPriorityaccessibilitySpeechIPANotationaccessibilitySpeechLanguageaccessibilitySpeechPitchaccessibilitySpeechPunctuationaccessibilitySpeechQueueAnnouncementaccessibilitySpeechSpellOutaccessibilityTextCustomaccessibilityTextHeadingLevelaccessibilityStrikethroughaccessibilityStrikethroughColoraccessibilitySuperscriptaccessibilityUnderlineaccessibilityUnderlineColorUIAccessibilityTextAttributeContext
Getting Markdown attribute keys
inlinePresentationIntentpresentationIntentAttributeNamemarkdownSourcePositionalternateDescriptionimageURL
Getting translation-related attribute keys
languageIdentifiermorphologyinflectionRuleinflectionAlternativeagreeWithArgumentagreeWithConceptreferentConceptlocalizedNumberFormat