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

# delegate

The window’s delegate.

```
weak var delegate: (any NSWindowDelegate)? { get set }
```

## Discussion

The value of this property is `nil` if the window doesn’t have a delegate.

A window object’s delegate is inserted in the responder chain after the window itself and is informed of various actions by the window through delegation messages.

## See Also

[`-  tryToPerform:with:`](/documentation/AppKit/NSWindow/tryToPerform(_:with:))

Dispatches action messages with a given argument.

[`-  sendAction:to:from:`](/documentation/AppKit/NSApplication/sendAction(_:to:from:))

Sends the given action message to the given target.



---

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)