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

# didChangeOcclusionStateNotification

Posted when the app’s occlusion state changes.

```
class let didChangeOcclusionStateNotification: NSNotification.Name
```

## Discussion

The system posts this notification on the main actor.  Upon receiving this notification, you can query the app for its occlusion state. Note that this only notifies about changes in the state of the occlusion, not when the occlusion region changes. You can use this notification to increase responsiveness and save power by halting any expensive calculations that the user can’t see.

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

---

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)