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

# sessionDidResignActiveNotification

A notification that the workspace posts before a user session switches out.

```
class let sessionDidResignActiveNotification: NSNotification.Name
```

## Discussion

This notification allows an app to disable some processing, such as when its user session switches out, and re-enable when that session switches back in.

The notification object is the shared [`NSWorkspace`](/documentation/AppKit/NSWorkspace) instance. The notification doesn’t contain a `userInfo` dictionary.

If an app launches in an inactive session, the workspace sends [`sessionDidResignActiveNotification`](/documentation/AppKit/NSWorkspace/sessionDidResignActiveNotification) after [`willFinishLaunchingNotification`](/documentation/AppKit/NSApplication/willFinishLaunchingNotification) and before sending [`didFinishLaunchingNotification`](/documentation/AppKit/NSApplication/didFinishLaunchingNotification).

> Important:
> To receive this notification, use ``doc://com.apple.appkit/documentation/AppKit/NSWorkspace/notificationCenter`` to register for it. If you use a different notification center to register, you won’t receive the notification.

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

---

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)