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

# delegate

The alert’s delegate.

## Declaration

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

## Discussion

Discussion To set a delegate for the alert, provide an object conforming to the NSAlertDelegateprotocol to this property. To remove the delegate, set this property’s value to nil.

## See Also

### Configuring Alerts

- [layout()](appkit/nsalert/layout().md)
- [alertStyle](appkit/nsalert/alertstyle.md)
- [accessoryView](appkit/nsalert/accessoryview.md)
- [showsHelp](appkit/nsalert/showshelp.md)
- [helpAnchor](appkit/nsalert/helpanchor.md)
