A structure which defines the placement of a toolbar item.¶
There are two types of placements:
- Semantic placements, such as .principal and .navigation, which denote the intent of the item being added. SwiftUI will determine the appropriate placement for the item based on this intent, as well as the current platform.
- Positional placements, such as .navigationBarLeading, which denote a precise placement for the item, usually for a particular platform.
Toolbar placements are used with the ToolbarItem when defining a toolbar. For example:
automatic The item is placed automatically, depending on many factors including the platform, size class, or presence of other items.
bottomBar The item is placed in the bottom toolbar. Applies to iOS, iPadOS, and Mac Catalyst.
cancellationAction The item represents a cancellation action for a modal interface.
confirmationAction The item represents a confirmation action for a modal interface.
destructiveAction The item represents a destructive action for a modal interface.
navigation The item represents a navigation action.
navigationBarLeading The item is placed in the leading edge of the navigation bar. Applies to iOS, iPadOS, tvOS, and Mac Catalyst.
navigationBarTrailing The item is placed in the trailing edge of the navigation bar. Applies to iOS, iPadOS, tvOS, and Mac Catalyst.
primaryAction The item represents a primary action.
principal The item is placed in the principal item section.
status The item represents a change in status for the current context.