UIAccessibilityAction Protocol Reference

(informal protocol)

Adopted by
Framework
/System/Library/Frameworks/UIKit.framework
Companion guide
Declared in
UIAccessibility.h

Overview

The UIAccessibilityAction informal protocol provides a way for accessibility elements to support specific actions, such as selecting values in a range or scrolling through information on the screen. For example, to respond to a scrolling gesture, you implement the accessibilityScroll: method and post UIAccessibilityPageScrolledNotification with the new page status (such as “Page 3 of 9”). Or, to make an element such as a slider or picker view accessible, you first need to characterize it by including the UIAccessibilityTraitAdjustable trait. Then, you must implement the accessibilityIncrement and accessibilityDecrement methods. When you do this, assistive technology users can adjust the element using gestures specific to the assistive technology.

Tasks

Performing an Action

Instance Methods

accessibilityDecrement

Adjusts the accessibility element so that its content is decreased.

- (void)accessibilityDecrement
Availability
  • Available in iOS 4.0 and later.
Declared In
UIAccessibility.h

accessibilityIncrement

Adjusts the accessibility element so that its content is increased.

- (void)accessibilityIncrement
Availability
  • Available in iOS 4.0 and later.
Declared In
UIAccessibility.h

accessibilityPerformEscape

Dismisses a modal view and returns the success or failure of the action.

- (BOOL)accessibilityPerformEscape
Return Value

YES if the modal view is successfully dismissed; otherwise, NO. By default, this method returns NO.

Discussion

Implement this method on an element or containing view that can be revealed modally or in a hierarchy. When a VoiceOver user performs a dismiss action, this method dismisses the view. For example, you might implement this method for a popover in order to give users a deliberate dismiss action to perform that closes the popover.

Availability
  • Available in iOS 5.0 and later.
Declared In
UIAccessibility.h

accessibilityPerformMagicTap

Performs a salient action.

- (BOOL)accessibilityPerformMagicTap
Return Value

YES if the magic tap action succeeds; otherwise, NO. By default, this method returns NO.

Discussion

The exact action performed by this method depends your app, typically toggling the most important state of the app. For example, in the Phone app it answers and ends phone calls, in the Music app it plays and pauses playback, in the Clock app it starts and stops a timer, and in the Camera app it takes a picture.

Availability
  • Available in iOS 6.0 and later.
Declared In
UIAccessibility.h

accessibilityScroll:

Scrolls screen content in an application-specific way and returns the success or failure of the action.

- (BOOL)accessibilityScroll:(UIAccessibilityScrollDirection)direction
Parameters
direction

A constant that specifies the direction of the scrolling action. See Scroll Directions for descriptions of valid constants.

Return Value

YES if the scrolling action succeeds; otherwise, NO. By default, this method returns NO.

Discussion

Implement this method if a view in the view hierarchy supports a scroll by page action.

  • If the scrolling action succeeds for the specified direction, return YES and post the UIAccessibilityPageScrolledNotification notification.

  • If the scrolling action fails, accessibilityScroll: is called on a parent view in the hierarchy.

Availability
  • Available in iOS 4.2 and later.
Declared In
UIAccessibility.h

Constants

UIAccessibilityScrollDirection

The direction of a scrolling action.

typedef enum {
   UIAccessibilityScrollDirectionRight = 1,
   UIAccessibilityScrollDirectionLeft,
   UIAccessibilityScrollDirectionUp,
   UIAccessibilityScrollDirectionDown,
   UIAccessibilityScrollDirectionNext,
   UIAccessibilityScrollDirectionPrevious
} UIAccessibilityScrollDirection;
Constants
UIAccessibilityScrollDirectionRight

The user is scrolling to the right.

Available in iOS 4.2 and later.

Declared in UIAccessibility.h.

UIAccessibilityScrollDirectionLeft

The user is scrolling to the left.

Available in iOS 4.2 and later.

Declared in UIAccessibility.h.

UIAccessibilityScrollDirectionUp

The user is scrolling up.

Available in iOS 4.2 and later.

Declared in UIAccessibility.h.

UIAccessibilityScrollDirectionDown

The user is scrolling down.

Available in iOS 4.2 and later.

Declared in UIAccessibility.h.

UIAccessibilityScrollDirectionNext

The user is scrolling to the next view in an ordered set of views.

Available in iOS 5.0 and later.

Declared in UIAccessibility.h.

UIAccessibilityScrollDirectionPrevious

The user is scrolling to the previous view in an ordered set of views.

Available in iOS 5.0 and later.

Declared in UIAccessibility.h.

Availability
  • Available in iOS 4.2 and later.
Declared In
UIAccessibility.h

Did this document help you? Yes It's good, but... Not helpful...