---
title: "init(notificationName:)"
framework: xctest
role: symbol
role_heading: Initializer
path: "xctest/xctdarwinnotificationexpectation/init(notificationname:)"
---

# init(notificationName:)

Creates an expectation that waits for a Darwin notification with the specified name to be posted.

## Declaration

```swift
init(notificationName: String)
```

## Parameters

- `notificationName`: The notification name to watch for.
