Declared in UIAccessibilityElement-KIFAdditions.h

Tasks

Class Methods

accessibilityElement:view:withLabel:value:traits:tappable:error:

+ (BOOL)accessibilityElement:(out UIAccessibilityElement **)foundElement view:(out UIView **)foundView withLabel:(NSString *)label value:(NSString *)value traits:(UIAccessibilityTraits)traits tappable:(BOOL)mustBeTappable error:(out NSError **)error

Parameters

foundElement

The found accessibility element or @c nil if the method returns @c NO. Can be @c NULL.

foundView

The first matching view for @c foundElement as determined by the accessibility API or @c nil if the view is hidden or fails the tappability test. Can be @c NULL.

label

The accessibility label of the element to wait for.

value

The accessibility value of the element to tap.

traits

The accessibility traits of the element to wait for. Elements that do not include at least these traits are ignored.

error

A reference to an error object to be populated when no matching element or view is found. Can be @c NULL.

Return Value

@c YES if the element and view were found. Otherwise @c NO.

Declared In

UIAccessibilityElement-KIFAdditions.h

accessibilityElementWithLabel:value:traits:error:

+ (UIAccessibilityElement *)accessibilityElementWithLabel:(NSString *)label value:(NSString *)value traits:(UIAccessibilityTraits)traits error:(out NSError **)error
Discussion

This functionality is identical to [UIApplication accessibilityElementWithLabel:accessibilityValue:traits:] except that it detailed error messaging in the case where the element cannot be found.

Parameters

label

The accessibility label of the element to wait for.

value

The accessibility value of the element to tap.

traits

The accessibility traits of the element to wait for. Elements that do not include at least these traits are ignored.

error

A reference to an error object to be populated when no element is found. Can be @c NULL.

Return Value

The found accessibility element. If @c nil see the @c error for a detailed reason.

Declared In

UIAccessibilityElement-KIFAdditions.h

viewContainingAccessibilityElement:

+ (UIView *)viewContainingAccessibilityElement:(UIAccessibilityElement *)element
Discussion

There is not always a one-to-one mapping between views and accessibility elements. Accessibility elements may not even map to the view you will expect. For instance, table view cell accessibility elements return the @c UITableView and keyboard keys map to the keyboard as a whole.

Parameters

element

The accessibility element.

Return Value

The first matching @c UIView as determined by the accessibility API.

Declared In

UIAccessibilityElement-KIFAdditions.h

viewContainingAccessibilityElement:tappable:error:

+ (UIView *)viewContainingAccessibilityElement:(UIAccessibilityElement *)element tappable:(BOOL)mustBeTappable error:(NSError **)error
Discussion

If the element is found, off screen, and is inside a scroll view, this method will attempt to programmatically scroll the view onto the screen before performing any logic as to if the view is tappable.

Parameters

element

The accessibility element.

mustBeTappable

If @c YES, a tappability test will be performed.

error

A reference to an error object to be populated when no element is found. Can be @c NULL.

Return Value

The first matching view as determined by the accessibility API or nil if the view is hidden or fails the tappability test.

Declared In

UIAccessibilityElement-KIFAdditions.h