Article

Removing the Title Bar in Your Mac App Built with Mac Catalyst

Display content that fills the entire height of a window by removing the title bar.

Overview

By default, Mac apps built with Mac Catalyst display a title bar across the top of their windows. A horizontal line separates the title bar from the content of the window.

Some Mac apps such as Messages and Contacts have no title bar in their main window. Instead, the top of the window shows only the Close, Minimize, and Zoom buttons with no separator between them and the window's content. In this UI design, the content area fills the entire height of the window.

The following image illustrates these styles in two windows. The first window displays a title bar, while the second has none.

Screenshot of two windows, one stacked above the other, with a dark background in the content area of each window.

Remove the Title Bar

If you choose to design your window without a title bar, you must remove it from the window. To remove the title bar, set the title bar’s titleVisibility property to UITitlebarTitleVisibility.hidden and the toolbar property to nil. The following code shows how to remove the title bar and its separator from the window during the setup of a new scene.

func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
    
    guard let windowScene = (scene as? UIWindowScene) else { return }
    
    #if targetEnvironment(macCatalyst)
    if let titlebar = windowScene.titlebar {
        titlebar.titleVisibility = .hidden
        titlebar.toolbar = nil
    }
    #endif

}

See Also

User Interface

UIKit Catalog: Creating and Customizing Views and Controls

Customize the user interface of your iOS apps and Mac apps built with Mac Catalyst by using views and controls in UIKit.

Toolbar

Provide a space for controls under a window's title bar and above your custom content.

Touch Bar

Display interactive content and controls in the Touch Bar.