<!--
{
  "availability" : [

  ],
  "documentType" : "symbol",
  "framework" : "XCTest",
  "identifier" : "/documentation/XCTest/XCTDarwinNotificationExpectation/init(notificationName:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "XCTest"
    ],
    "preciseIdentifier" : "c:objc(cs)XCTDarwinNotificationExpectation(im)initWithNotificationName:"
  },
  "title" : "init(notificationName:)"
}
-->

# init(notificationName:)

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

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

## Parameters

`notificationName`

The notification name to watch for.

---

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)