---
title: action
framework: appkit
role: symbol
role_heading: Instance Property
path: appkit/nstoolbaritem/action
---

# action

The action method to call when someone clicks on the toolbar item.

## Declaration

```swift
var action: Selector? { get set }
```

## Discussion

Discussion If you assign a custom view to the toolbar item, modifying this property updates the action property of the view or calls the setAction: method, if one of them exists. If the item doesn’t contain a custom view, the toolbar item manages the action directly.

## See Also

### Performing the item’s action

- [target](appkit/nstoolbaritem/target.md)
