<!--
{
  "availability" : [
    "macOS: 10.9.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSApplicationDelegate/applicationDidChangeOcclusionState(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(pl)NSApplicationDelegate(im)applicationDidChangeOcclusionState:"
  },
  "title" : "applicationDidChangeOcclusionState(_:)"
}
-->

# applicationDidChangeOcclusionState(_:)

Tells the delegate about changes to the app’s occlusion state.

```
@MainActor optional func applicationDidChangeOcclusionState(_ notification: Notification)
```

## Parameters

`notification`

A notification named [`didChangeOcclusionStateNotification`](/documentation/AppKit/NSApplication/didChangeOcclusionStateNotification). Calling the <doc://com.apple.documentation/documentation/Foundation/NSNotification/object> method of this notification returns the `NSApplication` object itself.

## Discussion

Upon receiving this method, you can query the application 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 method to increase responsiveness and save power by halting any expensive calculations that the user can not see.

---

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)