Instance Property

accessibilityTraits

The combination of traits that best characterize the accessibility element.

Declaration

@property(nonatomic, assign) UIAccessibilityTraits accessibilityTraits;

Discussion

A trait describes a single aspect of an element’s behavior, state, or usage. Several traits are combined in this property (using an OR operation) to give a complete picture of the element to an assistive application. See “Accessibility Traits” in UIAccessibility for a complete list of traits.

UIKit provides an appropriate combination of traits for all standard controls and views. When combining traits for a custom accessibility element, be sure to:

  • Use common sense. Don’t combine traits that characterize the element in mutually exclusive ways, such as combining the button and search-field traits.

  • Combine the traits you select with the superclass’s traits. Specifically, always combine your custom traits with [super accessibilityTraits] in the method you use to set a custom element’s traits.

See Also

Accessing the Attributes of an Accessibility Element

accessibilityLabel

A string that succinctly identifies the accessibility element.

accessibilityHint

A string that briefly describes the result of performing an action on the accessibility element.

accessibilityValue

A string that represents the current value of the accessibility element.

accessibilityFrame

The frame of the accessibility element, in screen coordinates.

accessibilityFrameInContainerSpace

The frame of the accessibility element, in the coordinate space of its container view.