NavigationStack - No Back Button

I created a very simple project with a NavigationStack and a NavigationLink as follows.

Code 1.

NavigationLink("Go To Next View", value: "TheView")
         .navigationDestination(for: String.self) { val in
                Text("Value = \(val)")
         }

This code works fine in the simple project. But when I put this simple code into my existing app's project using a NavigationStack, it navigates to the next view fine, but there is no back button. I am updating my Apple Watch target to use SwiftUI and I want to use NavigationStack.

My app does use @ObservedObject and my important data is using @Publish in a singleton class which conforms to ObservableObject. But this NavigationLink code, Code 1, is extremely simple and should work fine, but it does not.

The same problem happens with the following code.

Code 2

NavigationLink { NextView() } label: {
    MainRowView(rowText: "Saved")
}

When I switch to NavigationView, Code 1 is grayed out, but Code 2 works fine and has a back button. However, as you know, NavigationView is being deprecated, so I really need to fix this or have it fixed. I can't see how this could be a problem with my code as the code snippet is so simple and worked in the simple project.

Answered by SpaceMan in 722376022

I created a new project and deleted the WatchApp target. I then added a WatchApp target and copied the files from my existing project over. Now the watch navigates using NavigationStack, but it does not receive messages from the iPhone. There's always something.

I'm hoping for some guidance, whether it's a known bug or whether there's something stupid that I am doing. I don't discount the latter, which is why I've been easter-egging my project, but I think it's the former.

I filed a bug report on this. FB10908690 (NavigationStack - No Back Button). I apologize for having another post on this with the same issue. I hope that someone in the know will respond. I know this is not a bug that others have reported. I'm using Version 14.0 beta 4 (14A5284g) of Xcode.

Accepted Answer

I created a new project and deleted the WatchApp target. I then added a WatchApp target and copied the files from my existing project over. Now the watch navigates using NavigationStack, but it does not receive messages from the iPhone. There's always something.

The newly added Watch App had some build settings to set. Now it works fine and uses a NavigationStack!

NavigationStack - No Back Button
 
 
Q