---
title: handler
framework: xctest
role: symbol
role_heading: Instance Property
path: xctest/xctdarwinnotificationexpectation/handler-swift.property
---

# handler

An optional handler that performs custom evaluation of matching notifications.

## Declaration

```swift
var handler: XCTDarwinNotificationExpectation.Handler? { get set }
```

## Discussion

Discussion If provided, the custom handler will be queried each time a matching notification is received to determine whether the expectation should be fulfilled. This allows the handler to check Darwin state variables or perform other logic beyond simply verifying that the notification has been received.

## See Also

### Custom Notification Evaluation

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