File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ public class NavigationStackCompat: ObservableObject {
24
24
public static let defaultEasing = Animation . easeOut ( duration: 0.2 )
25
25
26
26
@Published var currentView : ViewElement ?
27
- private( set) var navigationType = NavigationType . push
27
+ @ Published private( set) var navigationType = NavigationType . push
28
28
private let easing : Animation
29
29
30
30
/// Creates a NavigationStackCompat.
@@ -57,8 +57,8 @@ public class NavigationStackCompat: ObservableObject {
57
57
/// - element: The destination view.
58
58
/// - identifier: The ID of the destination view (used to easily come back to it if needed).
59
59
public func push< Element: View > ( _ element: Element , withId identifier: String ? = nil ) {
60
+ navigationType = . push
60
61
withAnimation ( easing) {
61
- navigationType = . push
62
62
viewStack. push ( ViewElement ( id: identifier == nil ? UUID ( ) . uuidString : identifier!,
63
63
wrappedElement: AnyView ( element) ) )
64
64
}
@@ -67,8 +67,8 @@ public class NavigationStackCompat: ObservableObject {
67
67
/// Navigates back to a previous view.
68
68
/// - Parameter to: The destination type of the transition operation.
69
69
public func pop( to: PopDestination = . previous) {
70
+ navigationType = . pop
70
71
withAnimation ( easing) {
71
- navigationType = . pop
72
72
switch to {
73
73
case . root:
74
74
viewStack. popToRoot ( )
You can’t perform that action at this time.
0 commit comments