Contents

XCWaitCompletionHandler

A block the test runner calls when the test fulfills a waiter’s expectations, or when it times out.

Declaration

typealias XCWaitCompletionHandler = ((any Error)?) -> Void

Parameters

  • error:

    The error the waiter object encountered while waiting, which can be a timeout or a failure. See Code for a list of possible errors.

Discussion

Pass a block with this signature to waitForExpectations(timeout:handler:). Your block should handle any errors the waiter object encounters, including a timeout, and should perform assertions when the test fulfills the expectation for the waiter object.

See Also

Waiting for Expectations