Structure

NSAttributedString.Key

Attributes that you can apply to text in an attributed string.

Declaration

struct Key

Topics

Keys

static let accessibilityAutocorrected: NSAttributedString.Key

Autocorrected text (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.

static let accessibilityShadow: NSAttributedString.Key

Text shadow (NSNumber as a Boolean value).

static let accessibilityStrikethrough: NSAttributedString.Key

Text strikethrough (NSNumber as a Boolean value).

static let accessibilitySuperscript: NSAttributedString.Key

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

static let characterShapeAttributeName: NSAttributedString.Key

An integer value. The value is interpreted as Apple Type Services kCharacterShapeType selector + 1.

Deprecated
static let cursor: NSAttributedString.Key

The value of this attribute is an NSCursor object. The default value is the cursor returned by the iBeam method

static let glyphInfo: NSAttributedString.Key

The name of an NSGlyphInfo object.

static let superscript: NSAttributedString.Key

The value of this attribute is an NSNumber object containing an integer. The default value is 0.

static let toolTip: NSAttributedString.Key

The value of this attribute is an NSString object containing the tooltip text. The default value is nil, indicating no tooltip is available.

static let usesScreenFontsDocumentAttribute: NSAttributedString.Key

The value of this attribute is an NSNumber object containing a Boolean; this attribute corresponds to the usesScreenFonts method of NSLayoutManager; if absent, follows the system default setting

Deprecated

Type Properties

static let accessibilitySpeechLanguage: NSAttributedString.Key

A key indicating the language to use when speaking a string.

static let accessibilitySpeechPitch: NSAttributedString.Key

A key indicating the pitch to apply to spoken content.

static let accessibilitySpeechPunctuation: NSAttributedString.Key

A key indicating whether punctuation is spoken.

static let accessibilitySpeechQueueAnnouncement: NSAttributedString.Key

A key indicating whether the spoken text is queued behind, or interrupts, existing spoken content.

static let accessibilityTextCustom: NSAttributedString.Key

A key for specifying custom attributes to apply to the text.

static let accessibilityTextHeadingLevel: NSAttributedString.Key

A key for specifying the heading level of the text.

Relationships

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software