Instance Method

toolbarSelectableItemIdentifiers(_:)

Sent to discover the selectable item identifiers for a toolbar.

Declaration

optional func toolbarSelectableItemIdentifiers(_ toolbar: NSToolbar) -> [NSToolbarItem.Identifier]

Parameters

toolbar

The toolbar whose selectable item identifiers are to be returned.

Return Value

An array of item identifiers that should indicate selection in the specified toolbar.

Discussion

Toolbars that need to indicate item selection should return an array containing the identifiers of the selectable toolbar items.

If implemented, toolbar will display the currently selected item with a visual highlight. Clicking on an item whose identifier is selectable will automatically update the toolbar's selected item identifier, when possible. Clicking an item whose identifier is not selectable will not update the toolbar's selected item identifier.

See Also

Configuring a Toolbar

func toolbar(NSToolbar, itemForItemIdentifier: NSToolbarItem.Identifier, willBeInsertedIntoToolbar: Bool) -> NSToolbarItem?

Sent to request a new toolbar item; returns a toolbar item of the identified kind for the specified toolbar.

func toolbarAllowedItemIdentifiers(NSToolbar) -> [NSToolbarItem.Identifier]

Sent to discover the allowed item identifiers for a toolbar.

func toolbarDefaultItemIdentifiers(NSToolbar) -> [NSToolbarItem.Identifier]

Sent to discover the default item identifiers for a toolbar.