---
title: NSToolbarItemValidation
framework: appkit
role: symbol
role_heading: Protocol
path: appkit/nstoolbaritemvalidation
---

# NSToolbarItemValidation

Validation of a toolbar item.

## Declaration

```swift
protocol NSToolbarItemValidation : NSObjectProtocol
```

## Overview

Overview A toolbar item with a valid target and action is enabled by default. To allow a toolbar item to be disabled in certain situations, a toolbar item’s target can implement the validateToolbarItem(_:) method. note: The NSToolbarItem validate() method is called only if the item’s target has a valid action defined on its target and if the item isn’t a custom view item. If you want to validate a custom view item, then you have to subclass NSToolbarItem and override validate().

## Topics

### Enabling and disabling toolbar items

- [validateToolbarItem(_:)](appkit/nstoolbaritemvalidation/validatetoolbaritem(_:).md)

## Relationships

### Inherits From

- [NSObjectProtocol](objectivec/nsobjectprotocol.md)

## See Also

### View

- [Integrating a Toolbar and Touch Bar into Your App](appkit/integrating-a-toolbar-and-touch-bar-into-your-app.md)
- [NSToolbar](appkit/nstoolbar.md)
