Instance Method

touchBar(_:makeItemForIdentifier:)

Asks the delegate object for the bar item for the specified bar and item identifier.

Declaration

optional func touchBar(_ touchBar: NSTouchBar, makeItemForIdentifier identifier: NSTouchBarItem.Identifier) -> NSTouchBarItem?

Parameters

touchBar

The bar that's requesting the bar item.

identifier

The item identifier associated with the item being requested.

Return Value

A fully initialized bar item for the specified bar and identifier.

Discussion

When the system needs to populate a bar’s items array, the system calls this delegate method to retrieve an item if that item cannot be found in the bar’s private array or in the bar’s templateItems property.