BackNavigationModifier
@MainActor
public struct BackNavigationModifier : ViewModifier
A ViewModifier
that adds a custom back button for NavigationStack
views, which allows integration with NavigatingViewDestinationable
-conforming Views.
-
The button image to show for the back button.
Declaration
Swift
@MainActor public var buttonImage: Image
-
An optional action to perform when the button is tapped.
Declaration
Swift
@MainActor public var selectionAction: (() -> Void)?
-
The initializer.
Declaration
Swift
@MainActor public init(buttonImage: Image? = nil, selectionAction: (() -> Void)? = nil)
Parameters
buttonImage
The button image to show for the back button.
selectionAction
An optional action to perform when the button is tapped.
-
Declaration
Swift
@MainActor public func body(content: Content) -> some View