Protocol

NSToolbarItemValidation

Validation of a toolbar item.

Declaration

protocol NSToolbarItemValidation

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.

Topics

Instance Methods

func validateToolbarItem(NSToolbarItem) -> Bool

If this method is implemented and returns false, NSToolbar will disable theItem; returning true causes theItem to be enabled.

Required.

Relationships

Inherits From

See Also

View

Integrating a Toolbar and Touch Bar into Your App

Build a toolbar in your app’s window, with a corresponding Touch Bar, for quick access to app features.

class NSToolbar

An object that manages the space immediately below a window's title bar and above your app's custom content.