---
title: delegate
framework: appkit
role: symbol
role_heading: Instance Property
path: appkit/nswindow/delegate
---

# delegate

The window’s delegate.

## Declaration

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

## Discussion

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

### Related Documentation

- [tryToPerform(_:with:)](appkit/nswindow/trytoperform(_:with:).md)
- [sendAction(_:to:from:)](appkit/nsapplication/sendaction(_:to:from:).md)

### Managing the Window’s Behavior

- [NSWindowDelegate](appkit/nswindowdelegate.md)
