iOS Developer Library

Developer

UIKit Framework Reference UIAccessibilityContainer Protocol Reference

Options
Deployment Target:

On This Page
Language:

UIAccessibilityContainer

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. More...

Inheritance


Not Applicable

Conforms To


Not Applicable

Import Statement


import UIKit @import UIKit;

Availability


Available in iOS 3.0 and later.
  • Returns the number of accessibility elements in the container.

    Declaration

    Swift

    func accessibilityElementCount() -> Int

    Objective-C

    - (NSInteger)accessibilityElementCount

    Return Value

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

    Import Statement

    import UIKit

    Availability

    Available in iOS 3.0 and later.

  • Returns the accessibility element at the specified index.

    Declaration

    Swift

    func accessibilityElementAtIndex(_ index: Int) -> AnyObject!

    Objective-C

    - (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.

    Import Statement

    import UIKit

    Availability

    Available in iOS 3.0 and later.

  • Returns the index of the specified accessibility element.

    Declaration

    Swift

    func indexOfAccessibilityElement(_ element: AnyObject!) -> Int

    Objective-C

    - (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.

    Import Statement

    import UIKit

    Availability

    Available in iOS 3.0 and later.

  • An array of the accessibility elements in the container.

    Declaration

    Swift

    var accessibilityElements: [AnyObject]!

    Objective-C

    @property(nonatomic, strong) NSArray *accessibilityElements

    Discussion

    Containers can implement this property instead of the dynamic methods to support the retrieval of the contained elements. The default value of this property is nil.

    Import Statement

    import UIKit

    Availability

    Available in iOS 8.0 and later.