navigationStack
TypeScriptstatic get navigationStack(): ToolbarRoleSwift declarationstatic var navigationStack: ToolbarRole { get }The navigationStack role. Use this role for content that can be pushed and popped.
struct · iOS 16.0+ · SDK 27.1
struct ToolbarRoleThe purpose of content that populates the toolbar. 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 ``ToolbarRole/browser`` will automatically leading align the title of a toolbar in iPadOS. Provide this type to the ``View/toolbarRole(_:)`` modifier: ContentView() .navigationTitle("Browser") .toolbarRole(.browser) .toolbar { ToolbarItem(placement: .primaryAction) { AddButton() } }
static get navigationStack(): ToolbarRoleSwift declarationstatic var navigationStack: ToolbarRole { get }The navigationStack role. Use this role for content that can be pushed and popped.
static get editor(): ToolbarRoleSwift declarationstatic var editor: ToolbarRole { get }The editor role. Use this role for a toolbar that primarily displays controls geared towards editing document-like content. In iPadOS, this will leading align the navigation title, allow for toolbar items to occupy the center of the navigation bar, and provide a custom appearance for any back button present in the toolbar.
static get browser(): ToolbarRoleSwift declarationstatic var browser: ToolbarRole { get }The browser role. Use this role for content that can be navigated forwards and backwards. In iPadOS, this will leading align the navigation title and allow for toolbar items to occupy the center of the navigation bar.
static get automatic(): ToolbarRoleSwift declarationstatic var automatic: ToolbarRole { get }The automatic role. In iOS, tvOS, and watchOS this resolves to the ``ToolbarRole/navigationStack`` role. In macOS, this resolves to the ``ToolbarRole/editor`` role.
No declarations were skipped in this snapshot.