Text Attributed-String Attributes and Constants

Attributes and key constants used with attributed strings.

Topics

Constants

NSAccessibilityAutocorrectedTextAttribute

Autocorrected text (NSNumber as a Boolean value).

NSAccessibilityBackgroundColorTextAttribute

Text background color (CGColorRef).

NSAccessibilityForegroundColorTextAttribute

Text foreground color (CGColorRef).

NSAccessibilityUnderlineColorTextAttribute

Text underline color (CGColorRef).

NSAccessibilityStrikethroughColorTextAttribute

Text strikethrough color (CGColorRef).

NSAccessibilityUnderlineTextAttribute

Text underline style (NSNumber).

NSAccessibilitySuperscriptTextAttribute

Text superscript style (NSNumber). Values > 0 are superscript; values < 0 are subscript.

NSAccessibilityStrikethroughTextAttribute

Text strikethrough (NSNumber as a Boolean value).

NSAccessibilityShadowTextAttribute

Text shadow (NSNumber as a Boolean value).

NSAccessibilityMarkedMisspelledTextAttribute

Misspelled text that is visibly marked as misspelled (NSNumber as a Boolean value). If you’re implementing a custom text-editing app, use NSAccessibilityMarkedMisspelledTextAttribute to ensure that VoiceOver properly identifies misspelled text to users.

NSAccessibilityMisspelledTextAttribute

Misspelled text that isn’t necessarily visibly marked as misspelled (NSNumber as a Boolean value). Beginning in macOS 10.9, VoiceOver no longer checks for this attribute; instead, VoiceOver uses NSAccessibilityMarkedMisspelledTextAttribute.

NSAccessibilityFontTextAttribute

Font keys (NSDictionary).

NSAccessibilityFontNameKey

Required key for font name.

NSAccessibilityFontFamilyKey

Optional key for font family.

NSAccessibilityVisibleNameKey

Optional key for font visibility.

NSAccessibilityFontSizeKey

Required key for font size.