---
title: XCTDarwinNotificationExpectation
framework: xctest
role: symbol
role_heading: Class
path: xctest/xctdarwinnotificationexpectation
---

# XCTDarwinNotificationExpectation

An expectation that is fulfilled when an expected Darwin notification is received.

## Declaration

```swift
class XCTDarwinNotificationExpectation
```

## Overview

Overview If a custom handler value is not provided, the expectation will be fulfilled as soon as a matching Darwin notification is received from any process.

## Topics

### Creating Darwin Notification Expectations

- [init(notificationName:)](xctest/xctdarwinnotificationexpectation/init(notificationname:).md)

### Expectation Properties

- [notificationName](xctest/xctdarwinnotificationexpectation/notificationname.md)

### Custom Notification Evaluation

- [handler](xctest/xctdarwinnotificationexpectation/handler-swift.property.md)
- [XCTDarwinNotificationExpectation.Handler](xctest/xctdarwinnotificationexpectation/handler-swift.typealias.md)

## Relationships

### Inherits From

- [XCTestExpectation](xctest/xctestexpectation.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Notification-Based Expectations

- [XCTNSNotificationExpectation](xctest/xctnsnotificationexpectation.md)
