---
title: XCTNSNotificationExpectation.Handler
framework: xctest
role: symbol
role_heading: Type Alias
path: xctest/xctnsnotificationexpectation/handler-swift.typealias
---

# XCTNSNotificationExpectation.Handler

A custom handler to be called when a matching notification is received.

## Declaration

```swift
typealias Handler = @Sendable (Notification) -> Bool
```

## Parameters

- `notification`: The notification object.

## Return Value

Return Value Your custom handler should return true if the expectation is considered fulfilled after the notification is received, otherwise false.

## See Also

### Custom Notification Evaluation

- [handler](xctest/xctnsnotificationexpectation/handler-swift.property.md)
