Declared in NSObject+SLAccessibilityHierarchy.h

Overview

The methods in the UIView (SLAccessibility_Internal) category describe criteria that determine whether mock views will appear in the accessibility hierarchy.

Mock views are elements that UIAccessibility uses to represent certain views in the accessibility hierarchy rather than the views themselves.

3rd-party developers should have no need to use these methods.

Tasks

Class Methods

elementObject:isMockingViewObject:

Returns a Boolean value that indicates whether an object is a mock view.

+ (BOOL)elementObject:(id)elementObject isMockingViewObject:(id)viewObject

Parameters

elementObject

An object which may or may not be a mock view.

viewObject

An object which may or may not be a view.

Return Value

YES if viewObject is a UIView and elementObject is mocking that view, otherwise NO.

Discussion

Mock views are accessibility elements created by the accessibility system to represent certain views like UITableViewCells. Where a mock view exists, the accessibility system, and UIAutomation, read/manipulate it instead of the real view.

Declared In

NSObject+SLAccessibilityHierarchy.h

Instance Methods

classForcesPresenceOfMockingViewsInAccessibilityHierarchy

Returns a Boolean value that indicates whether the receiver’s class forces the presence of mock views in the accessibility hierarchy.

- (BOOL)classForcesPresenceOfMockingViewsInAccessibilityHierarchy

Return Value

YES if the receiver’s class forces the presence of objects mocking instances of the class in an accessibility hierarchy, otherwise NO.

Discussion

Experimentation reveals that objects mocking certain types of views will appear in UIAutomation’s accessibility hierarchy regardless of their accessibility identification.

Declared In

NSObject+SLAccessibilityHierarchy.h

elementMockingSelfWillAppearInAccessibilityHierarchy

Returns a Boolean value that indicates whether an object mocking the receiver will appear in an accessibility hierarchy.

- (BOOL)elementMockingSelfWillAppearInAccessibilityHierarchy

Return Value

YES if an object mocking the receiver will appear in an accessibility hierarchy, otherwise NO.

Discussion

Experimentation reveals that a mock view will appear in the accessibility hierarchy if the real object will appear in any accessibility hierarchy (see [NSObject willAppearInAccessibilityHierarchy]) or is an instance of one of a certain set of classes.

Declared In

NSObject+SLAccessibilityHierarchy.h