<!--
{
  "availability" : [

  ],
  "documentType" : "symbol",
  "framework" : "XCTest",
  "identifier" : "/documentation/XCTest/XCTWaiterDelegate",
  "metadataVersion" : "0.1.0",
  "role" : "Protocol",
  "symbol" : {
    "kind" : "Protocol",
    "modules" : [
      "XCTest"
    ],
    "preciseIdentifier" : "c:objc(pl)XCTWaiterDelegate"
  },
  "title" : "XCTWaiterDelegate"
}
-->

# XCTWaiterDelegate

Defines methods that are called when [`XCTWaiter`](/documentation/XCTest/XCTWaiter) expectations are fulfilled correctly or incorrectly.

```
protocol XCTWaiterDelegate : NSObjectProtocol
```

## Overview

[`XCTestCase`](/documentation/XCTest/XCTestCase) instances automatically conform to the [`XCTWaiterDelegate`](/documentation/XCTest/XCTWaiterDelegate) protocol. If you pass a test case instance as the delegate property of [`XCTWaiter`](/documentation/XCTest/XCTWaiter)’s [`init(delegate:)`](/documentation/XCTest/XCTWaiter/init(delegate:)) initializer, that test case will automatically report timeouts and other unexpected events as test failures.

## Topics

### Timeout Events

[`-  waiter:didTimeoutWithUnfulfilledExpectations:`](/documentation/XCTest/XCTWaiterDelegate/waiter(_:didTimeoutWithUnfulfilledExpectations:))

Invoked when not all waited on expectations are fulfilled during the timeout period.

[`-  nestedWaiter:wasInterruptedByTimedOutWaiter:`](/documentation/XCTest/XCTWaiterDelegate/nestedWaiter(_:wasInterruptedByTimedOutWaiter:))

Invoked when the waiter is interrupted prior to its expectations being fulfilled or timing out.

### Order of Fulfillment Events

[`-  waiter:fulfillmentDidViolateOrderingConstraintsForExpectation:requiredExpectation:`](/documentation/XCTest/XCTWaiterDelegate/waiter(_:fulfillmentDidViolateOrderingConstraintsFor:requiredExpectation:))

Invoked when a waiter is enforcing fulfillment order and an expectation is fulfilled in the wrong order.

### Inverted Expectation Events

[`-  waiter:didFulfillInvertedExpectation:`](/documentation/XCTest/XCTWaiterDelegate/waiter(_:didFulfillInvertedExpectation:))

Invoked when an expectation whose `isInverted` property is set to `true` is fulfilled.

## Relationships

### Conforming Types

[`XCTestCase`](/documentation/XCTest/XCTestCase)

### Inherits From

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)