NSToolbar
An object that manages the space above your app’s custom content and either below or integrated with the window’s title bar.
Declaration
@MainActor class NSToolbarOverview
An NSToolbar object manages the controls and views that apply to the main window’s content area. Toolbars provide convenient access to the commands and features people use most often. Toolbars are also user-configurable and support the display of an interactive customization palette.
Create and configure your toolbar programmatically or using Interface Builder. Add items to the toolbar that correspond to the commands you want to feature in your window. Each item has a corresponding NSToolbarItem object, which you use to make changes. Each toolbar manages a unique set of items, but you can synchronize the items and state of multiple toolbars by assigning the same value to their identifier properties.
For more information about how to use toolbars, see Integrating a Toolbar and Touch Bar into Your App.
Topics
Creating an toolbar object
Configuring the toolbar contents
Getting the toolbar’s identity
Configuring the toolbar’s behavior
isVisibledisplayModeNSToolbar.DisplayModeshowsBaselineSeparatorallowsUserCustomizationallowsExtensionItems
Managing items on the toolbar
itemsvisibleItemscenteredItemIdentifiersselectedItemIdentifierwillAddItemNotificationdidRemoveItemNotificationinsertItem(withItemIdentifier:at:)removeItem(at:)
Autosaving the configuration
Displaying the customization palette
Validating visible items
Deprecated
centeredItemIdentifierfullScreenAccessoryViewfullScreenAccessoryViewMinHeightfullScreenAccessoryViewMaxHeightsizeModeNSToolbar.SizeMode