<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSApplication/willTerminateNotification",
  "metadataVersion" : "0.1.0",
  "role" : "Type Property",
  "symbol" : {
    "kind" : "Type Property",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:@NSApplicationWillTerminateNotification"
  },
  "title" : "willTerminateNotification"
}
-->

# willTerminateNotification

Sends a notification to terminate the app.

```
class let willTerminateNotification: NSNotification.Name
```

## Discussion

The system posts this notification on the main actor in response to the [`terminate(_:)`](/documentation/AppKit/NSApplication/terminate(_:)) method, and only posted if the delegate method [`applicationShouldTerminate(_:)`](/documentation/AppKit/NSApplicationDelegate/applicationShouldTerminate(_:)) returns <doc://com.apple.documentation/documentation/Swift/true>. The notification object is [`shared`](/documentation/AppKit/NSApplication/shared). This notification doesn’t contain a `userInfo` dictionary.

> Note:
> This notification isn’t sent during sudden termination of an app. For more information about sudden termination, see the section  <doc://com.apple.documentation/documentation/Foundation/ProcessInfo> of <doc://com.apple.documentation/documentation/Foundation/ProcessInfo>.

To observe this notification using Swift concurrency, use [`NSApplication.WillTerminateMessage`](/documentation/AppKit/NSApplication/WillTerminateMessage).

---

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)