UIAccessibilityContainer Protocol Reference

(informal protocol)

Adopted by
Framework
/System/Library/Frameworks/UIKit.framework
Availability
Available in iOS 3.0 and later.
Companion guide
Declared in
UIAccessibility.h

Overview

The UIAccessibilityContainer informal protocol provides a way for UIView subclasses to make selected components accessible as separate elements. For example, a view might contain icons or drawn text that, to end users, appear and function as separate items. But because these components are not implemented as instances of UIView, they are not automatically accessible to users with disabilities. Therefore, such a container view should implement the UIAccessibilityContainer methods to supply accessibility information about these components to assistive applications such as VoiceOver.

A view that implements the UIAccessibilityContainer informal protocol uses the UIAccessibilityElement method initWithAccessibilityContainer: to create an accessibility element to represent each non-view component that needs to be accessible to users with disabilities. Note, however, that the container view itself is not an accessibility element because users interact with the contents, not with the container. This means that a container view that implements the UIAccessibilityContainer methods must set to NO the isAccessibilityElement property of the UIAccessibility informal protocol.

The order of accessibility elements within the container view should be the same as the order in which the represented elements are presented to the user, from top-left to bottom-right.

Tasks

Providing Information About Accessibility Elements

Instance Methods

accessibilityElementAtIndex:

Returns the accessibility element at the specified index.

- (id)accessibilityElementAtIndex:(NSInteger)index
Parameters
index

The index of the accessibility element.

Return Value

The accessibility element at the specified index, or nil if none exists.

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

accessibilityElementCount

Returns the number of accessibility elements in the container.

- (NSInteger)accessibilityElementCount
Return Value

The number of accessibility elements in the container. By default, this method returns 0.

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

indexOfAccessibilityElement:

Returns the index of the specified accessibility element.

- (NSInteger)indexOfAccessibilityElement:(id)element
Parameters
element

The accessibility element.

Return Value

The index of the specified accessibility element, or NSNotFound if the element does not exist.

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