Instance Method

expectation(for:evaluatedWith:handler:)

Creates an expectation that is fulfilled if predicate returns true when evaluated with the given object.

Declaration

func expectation(for predicate: NSPredicate, evaluatedWith object: Any, handler: XCPredicateExpectationHandler? = nil) -> XCTestExpectation

Discussion

The expectation periodically evaluates the predicate and also may use notifications or other events to optimistically re-evaluate.