---
title: NSThreadWillExit
framework: foundation
role: symbol
role_heading: Type Property
path: foundation/nsnotification/name-swift.struct/nsthreadwillexit
---

# NSThreadWillExit

An NSThread object posts this notification when it receives the exit() message, before the thread exits. Observer methods invoked to receive this notification execute in the exiting thread, before it exits.

## Declaration

```swift
static let NSThreadWillExit: NSNotification.Name
```

## Discussion

Discussion The notification object is the exiting NSThread object. This notification does not contain a userInfo dictionary.

## See Also

### Notifications

- [NSDidBecomeSingleThreaded](foundation/nsnotification/name-swift.struct/nsdidbecomesinglethreaded.md)
- [NSWillBecomeMultiThreaded](foundation/nsnotification/name-swift.struct/nswillbecomemultithreaded.md)
