<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSAlert/window",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSAlert(py)window"
  },
  "title" : "window"
}
-->

# window

The app-modal panel or document-modal sheet that corresponds to the alert.

```
var window: NSWindow { get }
```

## Discussion

The alert’s window is of type [`NSPanel`](/documentation/AppKit/NSPanel). Use this property when you want to dismiss an alert created with the [`beginSheetModal(for:completionHandler:)`](/documentation/AppKit/NSAlert/beginSheetModal(for:completionHandler:)) method within that method’s completion handler block.

---

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)