macOS window with integrated title bar and toolbar?

Kornel picture Kornel · Jun 3, 2014 · Viewed 18.3k times · Source

In macOS how can I create a window with an "integrated title bar and toolbar" in Xcode and/or Interface Builder?

This is the "fat title bar" type of window that was added to apps such as Safari and Calendar in OS X 10.10 Yosemite. Unified title bar and toolbar plus other gadgets.

macOS Human Interface Guidelines: Title Bar and Toolbar

A toolbar, when included, resides beneath the title bar (or is integrated with the title bar) and includes controls—known as toolbar items—that provide quick access to frequently used commands and features.

Integrated title bar and toolbar

Integrated title bar and toolbar

Answer

Kornel picture Kornel · Jun 4, 2014
  1. Create a standard toolbar.
  2. When the window loads, set titleVisibility to hidden:

    // Objective-C
    window.titleVisibility = NSWindowTitleHidden;
    
    // Swift
    window?.titleVisibility = .hidden