Contents

toolbarTitleMenu(content:)

Configure the title menu of a toolbar.

Declaration

nonisolated func toolbarTitleMenu<C>(@ViewBuilder content: () -> C) -> some View where C : View

Parameters

  • content:

    The content associated to the toolbar title menu.

Discussion

A title menu represent common functionality that can be done on the content represented by your app’s toolbar or navigation title. This menu may be populated from your app’s commands like saveItem or printItem.

ContentView()
    .toolbar {
        ToolbarTitleMenu()
    }

You can provide your own set of actions to override this behavior.

ContentView()
    .toolbarTitleMenu {
        DuplicateButton()
        PrintButton()
    }

In iOS and iPadOS, this will construct a menu that can be presented by tapping the navigation title in the app’s navigation bar.

See Also

Setting the toolbar title menu