ToolbarRole
The purpose of content that populates the toolbar.
Declaration
struct ToolbarRoleOverview
A toolbar role provides a description of the purpose of content that populates the toolbar. The purpose of the content influences how a toolbar renders its content. For example, a browser will automatically leading align the title of a toolbar in iPadOS.
Provide this type to the toolbarRole(_:) modifier:
ContentView()
.navigationTitle("Browser")
.toolbarRole(.browser)
.toolbar {
ToolbarItem(placement: .primaryAction) {
AddButton()
}
}