Text Attributed-String Attributes and Constants

Attributes and key constants used with attributed strings.

Topics

Constants

static let accessibilityAutocorrected: NSAttributedString.Key

Autocorrected text (NSNumber as a Boolean value).

static let accessibilitySuperscript: NSAttributedString.Key

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

static let accessibilityStrikethrough: NSAttributedString.Key

Text strikethrough (NSNumber as a Boolean value).

static let accessibilityShadow: NSAttributedString.Key

Text shadow (NSNumber as a Boolean value).

static let accessibilityMarkedMisspelled: NSAttributedString.Key

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.

static let accessibilityMisspelled: NSAttributedString.Key

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 accessibilityMarkedMisspelled.