Instance Property

accessibilityTraits

The combination of accessibility traits that best characterize the accessibility element.

Declaration

var accessibilityTraits: UIAccessibilityTraits { get set }

Discussion

The default value for this property is none unless the receiver is a UIKit control, in which case the value is the standard set of traits associated with the control.

If you implement a custom control or view, you need to select all the accessibility traits that best characterize the object and combine them with its superclass’s traits (in other words, with super.accessibilityTraits) by performing an OR operation. See Accessibility Traits for a complete list of traits.

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 accessibilityHint: String?

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

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.