Protocol: UIAccessibility

Overview

The UIAccessibility informal protocol provides accessibility information about an application’s user interface elements. Assistive applications, such as VoiceOver, convey this information to users with disabilities to help them use the application.The activation point for the accessibility element, in screen coordinates.A Boolean value indicating whether the accessibility elements contained within this accessibility element are hidden.The frame of the accessibility element, in screen coordinates.A brief description of the result of performing an action on the accessibility element, in a localized string.A succinct label that identifies the accessibility element, in a localized string.The language in which to speak the accessibility element’s label, value, and hint.The combination of accessibility traits that best characterize the accessibility element. The value of the accessibility element, in a localized string.A Boolean value indicating whether VoiceOver should ignore the elements within views that are siblings of the receiver.A Boolean value indicating whether the receiver is an accessibility element that an assistive application can access.A Boolean value indicating whether VoiceOver should group together the elements that are children of the receiver, regardless of their positions on the screen.A mask that contains the OR combination of the accessibility traits that best characterize an accessibility element.Accessibility traits that tell an assistive application how an accessibility element behaves or should be treated.The types of system Zoom that can be in effect.A notification that an accessible application can send.Keys used in the userInfo parameter dictionary of notifications.

Instance Attribute Summary (collapse)

Instance Attribute Details

- (CGPoint) accessibilityActivationPoint

The activation point for the accessibility element, in screen coordinates. The default value for this property is the midpoint of the accessibility element’s frame, which is given by accessibilityFrame. The activation point for an element is the specific area VoiceOver activates when a user double-taps the element. The ability to specify an activation point allows an element to present to VoiceOver different points in different circumstances without changing how the element presents itself. For example, the standard activation point for a Home screen app icon is the midpoint of the icon. But when the user is rearranging icons on the Home screen, the activation point changes to the midpoint of the remove control (that is, to the circled X in the upper-left corner of the icon).You can also use this property to ensure that the activation point for a small element remains accurate even if you present a larger version of the element to VoiceOver.

Returns:

  • (CGPoint)

- (Boolean) accessibilityElementsHidden

A Boolean value indicating whether the accessibility elements contained within this accessibility element are hidden. The default value for this property is NO. You might use this property to hide views that are covered by the arrival of a new view. In this case, the hidden views might remain visible onscreen, but they are not the focus of the user’s actions.You might also use this property to hide a transient view that VoiceOver users don’t need to notice. For example, VoiceOver doesn’t need to describe the translucent view that appears when users adjust the volume on their devices, because the aural feedback of this action is sufficient.

Returns:

  • (Boolean)

- (CGRect) accessibilityFrame

The frame of the accessibility element, in screen coordinates. The default value for this property is CGRectZero unless the receiver is a UIView object or is a subclass of UIView, in which case the value is the frame of the view.You must set this property for an accessibility element that represents an object that is not a subclass of UIView, because the screen coordinates of such an object are not already known. (You do not have to set this property for an accessibility element that represents a subclass of UIView, because such an object’s screen coordinates are already known.)

Returns:

- (String) accessibilityHint

A brief description of the result of performing an action on the accessibility element, in a localized string. 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:The hint should be a very brief phrase that begins with a verb that names the results of the action, such as “Plays the song” or “Purchases the item.” 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.”

Returns:

- (String) accessibilityLabel

A succinct label that identifies the accessibility element, in a localized string. The default value for this property is nil unless the receiver is a UIKit control, in which case the value is a label derived from the control’s title.Note: If you supply UIImage objects to display in a UISegmentedControl, you can set this property on each image to ensure that the segments are properly accessible.If you implement a custom control or view, or if you display a custom icon on a UIKit control, you should set this property to make sure your accessibility elements have appropriate labels. If an accessibility element does not display a descriptive label, set this property to supply a short, localized label that succinctly identifies the element. For example, a “Play music” button might display an icon that shows sighted users what it does. To be accessible, however, the button should have the accessibility label “Play” or “Play music” so that an assistive application can provide this information to users with disabilities. Note, however, that the label should never include the control type (such as “button”) because this information is contained in the traits associated with the accessibility element.

Returns:

- (String) accessibilityLanguage

The language in which to speak the accessibility element’s label, value, and hint. The default value for this property is nil. If no language is set, the user’s current language setting is used.If you need to set this property, be sure to use a language ID tag that follows the format defined in the BCP 47 specification. A draft of this specification is available at www.rfc-editor.org/.

Returns:

- (UIAccessibilityTraits) accessibilityTraits

The combination of accessibility traits that best characterize the accessibility element. The default value for this property is UIAccessibilityTraitNone 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.

Returns:

  • (UIAccessibilityTraits)

- (String) accessibilityValue

The value of the accessibility element, in a localized string. The default value for this property is nil unless the receiver is a UIKit control, in which case value of the property represents the value of the control, when it differs from the label.When an accessibility element has a static label, and a dynamic value, you should set this property to return the value. For example, although an accessibility element that represents a text field might have the label “Message,” its value is the text currently inside the text field.

Returns:

- (Boolean) accessibilityViewIsModal

A Boolean value indicating whether VoiceOver should ignore the elements within views that are siblings of the receiver. The default value for this property is NO. When the value of this property is YES, VoiceOver ignores the elements within the sibling views of the receiving view.For example, in a window that contains sibling views A and B, setting accessibilityViewIsModal to YES on view B causes VoiceOver to ignore the elements in the view A. On the other hand, if view B contains a child view C and you set accessibilityViewIsModal to YES on view C, VoiceOver does not ignore the elements in view A.

Returns:

  • (Boolean)

- (Boolean) isAccessibilityElement

A Boolean value indicating whether the receiver is an accessibility element that an assistive application can access. The default value for this property is NO unless the receiver is a standard UIKit control, in which case the value is YES. Assistive applications can get only information about objects that are represented by accessibility elements. Therefore, if you implement a custom control or view that should be accessible to users with disabilities, you should set this property to YES. The only exception to this practice is a view that merely serves as a container for other items that should be accessible. Such a view should implement the UIAccessibilityContainer protocol and set this property to NO.

Returns:

  • (Boolean)

- (Boolean) shouldGroupAccessibilityChildren

A Boolean value indicating whether VoiceOver should group together the elements that are children of the receiver, regardless of their positions on the screen. The default value for this property is NO.For example, consider an app that shows items in vertical columns. Normally, VoiceOver would navigate through these items in horizontal rows. Setting the value of this property to YES on the parent view of the items in the vertical columns causes VoiceOver to respect the app’s grouping and navigate them correctly.

Returns:

  • (Boolean)