Skip to content

Commit 9e45f85

Browse files
committed
Merge branch 'develop'
2 parents d6bab88 + dedbaf3 commit 9e45f85

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Sources/NavigationStack/NavigationStackCompat.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public class NavigationStackCompat: ObservableObject {
2424
public static let defaultEasing = Animation.easeOut(duration: 0.2)
2525

2626
@Published var currentView: ViewElement?
27-
private(set) var navigationType = NavigationType.push
27+
@Published private(set) var navigationType = NavigationType.push
2828
private let easing: Animation
2929

3030
/// Creates a NavigationStackCompat.
@@ -57,8 +57,8 @@ public class NavigationStackCompat: ObservableObject {
5757
/// - element: The destination view.
5858
/// - identifier: The ID of the destination view (used to easily come back to it if needed).
5959
public func push<Element: View>(_ element: Element, withId identifier: String? = nil) {
60+
navigationType = .push
6061
withAnimation(easing) {
61-
navigationType = .push
6262
viewStack.push(ViewElement(id: identifier == nil ? UUID().uuidString : identifier!,
6363
wrappedElement: AnyView(element)))
6464
}
@@ -67,8 +67,8 @@ public class NavigationStackCompat: ObservableObject {
6767
/// Navigates back to a previous view.
6868
/// - Parameter to: The destination type of the transition operation.
6969
public func pop(to: PopDestination = .previous) {
70+
navigationType = .pop
7071
withAnimation(easing) {
71-
navigationType = .pop
7272
switch to {
7373
case .root:
7474
viewStack.popToRoot()

0 commit comments

Comments
 (0)