I'm trying out the new NavigationView in watchOS 7 and having some issues with the navigation bar not showing up in child views.
Confusingly, the Xcode live preview does the opposite: The root view is missing the navigation bar, but the destination view is showing both the title and back button correctly.
The only mode in which the navigation bar is visible in both views is if I from Xcode select Preview on Device.
I'm new to SwiftUI and though I'm leaning toward this being a bug with the beta, I thought I'd check here to make sure I'm not just doing it wrong.
Example
Code Block swift import SwiftUI struct ContentView: View { var body: some View { NavigationView { NavigationLink( destination: DestinationView(), label: { Text("Destination") }) .navigationTitle("Root") } } } struct DestinationView: View { var body: some View { NavigationView { Text("I'm here!") .navigationTitle("Destination") } } }
Test setup
macOS 11.0 Beta 5
watchOS 7.0 Beta 6
Xcode 12.0 Beta 6
Confusingly, the Xcode live preview does the opposite: The root view is missing the navigation bar, but the destination view is showing both the title and back button correctly.
The only mode in which the navigation bar is visible in both views is if I from Xcode select Preview on Device.
I'm new to SwiftUI and though I'm leaning toward this being a bug with the beta, I thought I'd check here to make sure I'm not just doing it wrong.