ToolbarSample: Using NSToolbar to construct a window toolbar

Last Revision:
Version 5.1, 2018-05-03
Upgraded to Swift 4.
(Full Revision History)
Build Requirements:
Xcode 9.3 or later; macOS 10.13 SDK or later
Runtime Requirements:
macOS 10.11 or later

This sample shows how to use the AppKit's NSToolbar and NSToolbarItem classes. These are used to add customizable toolbars to windows. This sample also includes more advanced use of custom views in NSToolbarItems, where you can put a variety of controls, given a little more coding. This sample implements the NSTouchBar API to work in conjunction with the toolbar.