Validation of a toolbar item.


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.


Validating toolbar items

func validateToolbarItem(NSToolbarItem)

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

See Also


protocol NSToolbarDelegate

A set of optional methods implemented by toolbar delegates to configure the toolbar and respond to changes.