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 attention-grabbing 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 perform routeToView .. I appended one other path

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

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


my Routing is solely

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

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

public func popToRoot() {
    path = NavigationPath()


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

My guess that the navigationDestination would not re-evaluate the view until the navigation Path totally established.
However I am unable to determine tips on how to come over such problem


Leave a Reply

Your email address will not be published. Required fields are marked *