Declared in UIApplication-KIFAdditions.h

Tasks

Class Methods

startMockingOpenURLWithReturnValue:

+ (void)startMockingOpenURLWithReturnValue:(BOOL)returnValue
Discussion

After calling this method, whenever @c -openURL: is called a notification named @c UIApplicationDidMockOpenURLNotification with the URL in the @c UIApplicationOpenedURL will be raised and the normal behavior will be cancelled.

Parameters

returnValue

The value to return when @c -openURL: is called.

Declared In

UIApplication-KIFAdditions.h

stopMockingOpenURL

Stops the application from mocking requests to @c -openURL:.

+ (void)stopMockingOpenURL

Declared In

UIApplication-KIFAdditions.h

swizzleRunLoop

Swizzles the run loop modes so KIF can better switch between them.

+ (void)swizzleRunLoop

Declared In

UIApplication-KIFAdditions.h

Instance Methods

accessibilityElementMatchingBlock:

- (UIAccessibilityElement *)accessibilityElementMatchingBlock:(BOOL ( ^ ) ( UIAccessibilityElement *))matchBlock
Discussion

This method should be used if @c accessibilityElementWithLabel:accessibilityValue:traits: does not meet your requirements. For example, if you are searching for an element that begins with a pattern or if of a certain view type.

Parameters

matchBlock

A block to be performed on each element to see if it passes.

Declared In

UIApplication-KIFAdditions.h

accessibilityElementWithLabel:accessibilityValue:traits:

Finds an accessibility element with a matching label, value, and traits across all windows in the application starting at the frontmost window.

- (UIAccessibilityElement *)accessibilityElementWithLabel:(NSString *)label accessibilityValue:(NSString *)value traits:(UIAccessibilityTraits)traits

Parameters

label

The accessibility label of the element to search for.

value

The accessibility value of the element to search for. If @c nil, all values will be accepted.

traits

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

Return Value

The found accessibility element or @c nil if the element could not be found.

Declared In

UIApplication-KIFAdditions.h

currentRunLoopMode

The current run loop mode.

- (CFStringRef)currentRunLoopMode

Return Value

The current run loop mode.

Declared In

UIApplication-KIFAdditions.h

datePickerWindow

The topmost window containing a @c UIDatePicker.

- (UIWindow *)datePickerWindow

Return Value

The topmost window containing a @c UIDatePicker.

Declared In

UIApplication-KIFAdditions.h

dimmingViewWindow

The topmost window containing a @c UIDimmingView.

- (UIWindow *)dimmingViewWindow

Return Value

The topmost window containing a @c UIDimmingView.

Declared In

UIApplication-KIFAdditions.h

keyboardWindow

The window containing the keyboard or @c nil if the keyboard is not visible.

- (UIWindow *)keyboardWindow

Return Value

The window containing the keyboard or @c nil if the keyboard is not visible.

Declared In

UIApplication-KIFAdditions.h

pickerViewWindow

The topmost window containing a @c UIPickerView.

- (UIWindow *)pickerViewWindow

Return Value

The topmost window containing a @c UIPickerView.

Declared In

UIApplication-KIFAdditions.h

windowsWithKeyWindow

All windows in the application, including the key window even if it does not appear in @c -windows.

- (NSArray *)windowsWithKeyWindow

Return Value

All windows in the application, including the key window even if it does not appear in @c -windows.

Declared In

UIApplication-KIFAdditions.h

writeScreenshotForLine:inFile:description:error:

- (BOOL)writeScreenshotForLine:(NSUInteger)lineNumber inFile:(NSString *)filename description:(NSString *)description error:(NSError **)error
Discussion

This method only works if the @c KIF_SCREENSHOTS environment variable is set.

Parameters

lineNumber

The line number in the code at which the screenshot was taken.

filename

The name of the file in which the screenshot was taken.

description

An optional description of the scene being captured.

error

If the method returns @c YES, this optional parameter provides additional information as to why it failed.

Return Value

@c YES if the screenshot was written to disk, otherwise @c NO.

Declared In

UIApplication-KIFAdditions.h