ios – SwiftUI 4 NavigationStack Append View in navigationDestination fail


I used to be making an attempt the brand new NavigationStack in swiftUI 4 and I discovered an fascinating downside

If I created a view like that

         .navigationDestination(for: Route.self, vacation spot: { route in
                            NavigationBarContainerView {
                                ViewRouter().routeToView(with: route)

Then I appended a routing Path to it


then contained in the operate routeToView .. I appended one other path

func routeToView(with route: Route) -> some View {
   change route {

      case .confirmEmail:
       Textual content("2")
        .onAppear {
       case .passwordRecovery:


my Routing is just

public class Routing: ObservableObject {
public static let shared = Routing()
@Revealed public var path: NavigationPath = NavigationPath()
non-public init() {}

public func appendPath(_ route: Route) {
    DispatchQueue.major.async {

public func popToRoot() {
    path = NavigationPath()


it by no means reveals the password restoration display. I Thought it is sort of race situation, since it really works high quality if i add a delayer or sleep. however I attempted to append two routes on the beginning, it really works high quality..

My guess that the navigationDestination does not re-evaluate the view until the navigation Path totally established.
However I can not work out come over such subject


Leave a Reply