Instance Property

accessibilityHint

A brief description of the result of performing an action on the accessibility element, in a localized string.

Declaration

var accessibilityHint: String? { get set }

Discussion

The default value for this property is nil unless the receiver is a UIKit control, in which case the value is a system-provided hint based on the type of control.

An accessibility hint helps users understand what will happen when they perform an action on the accessibility element when that result is not obvious from the accessibility label. For example, if you provide an Add button in your application, the button’s accessibility label helps users understand that tapping the button adds values in the application. If, on the other hand, your application allows users to play a song by tapping its title in a list of song titles, the accessibility label for the list row does not tell users this. To help an assistive application provide this information to users with disabilities, an appropriate hint for the list row would be “Plays the song.”

Follow these guidelines to create a hint for an accessibility element:

  • Begin with a verb that names the results of the action, such as “Plays the song” or “Purchases the item” in a very brief phrase.

    Avoid beginning the phrase with the imperative form of a verb, because this can make the hint sound like a command. For example, do not create a hint such as “Play the song” or “Purchase the item.”

  • Don’t repeat the action type in the hint. For example, do not create hints such as “Tap to play the song” or “Tapping plays the song.”

  • Don’t repeat the control or view type in the hint. For example, do not create hints such as “Plays the song in the row” or “Button that adds a contact name.”

See Also

Defining Accessibility Text and Language

Speech Attributes for Attributed Strings

Apply attributes to text in an attributed string to modify how that text is pronounced.

Text Attributes for Attributed Strings

Apply attributes to text in an attributed string to convey extra information about the text.

var accessibilityHeaderElements: [Any]?

An array of elements considered to be the headers for this element.

var accessibilityAttributedHint: NSAttributedString?

The underlying attributed version of the accessibility hint.

var accessibilityAttributedLabel: NSAttributedString?

The underlying attributed version of the accessibility label.

var accessibilityLabel: String?

A succinct label that identifies the accessibility element, in a localized string.

var accessibilityLanguage: String?

The language in which to speak the accessibility element's label, value, and hint.

var accessibilityTextualContext: UIAccessibilityTextualContext?

A named context that helps identify and classify the type of text inside an element.

var accessibilityAttributedUserInputLabels: [NSAttributedString]!

The underlying attributed versions of the accessibility user input labels.

var accessibilityUserInputLabels: [String]!

An array of localized labels the user provides to refer to this element.

var accessibilityAttributedValue: NSAttributedString?

The underlying attributed version of the accessibility value.

var accessibilityValue: String?

The value of the accessibility element, in a localized string.