Contents

wait(for:)

Creates a waiter that waits on a group of expectations.

Declaration

class func wait(for expectations: [XCTestExpectation]) -> XCTWaiter.Result

Parameters

  • expectations:

    An array of expectations the test must satisfy.

Return Value

A value describing the outcome of waiting for expectations.

Discussion

In Objective-C code, you might use an expectation to wait on a call to an interface that uses a completion handler to return a result. In Swift, consider calling withCheckedContinuation(function:_:) to use Concurrency instead of an expectation to wait on the result.

See Also

Waiting for Expectations