Hello all
My first SwiftUI program..and I have to say I'm not really impressed with this...
Issue is when I open the second View, the blue "< Back" menu item never shows up.
I have a NavigationLink to open a seperate View.
Yet when the secondary view opens, the "< Back" menu item never displays.
From ContentView.swift:
HStack {
NavigationLink(destination: DetailView()) {
Text("Summary")
}.navigationBarTitle(" ").navigationBarHidden(false)
From the DetailView.swift file:
var body: some View {
NavigationView {
Group {
VStack {
Text("Detail View")
}
}
}.navigationBarHidden(false).navigationBarBackButtonHidden(false)
}
I have been fighting with this for over 12 hours now. Quite frankly it is giving me the impression that SwiftUI is not worth the time or effort, and it is not designed to work at all. As this was something that could be done with storyboards in 20 minutes. This is extremely frustrating.
So any help at this point would be appreciated.
It looks like your content view isn't wrapped in a NavigationView, only the detail. That won't work, it's like a parent/detail relationship.
ContentView.swift:
var body: some View {
NavigationView {
HStack {
NavigationLink(destination: DetailView()) {
Text("Summary")
}
}
}
}
From the DetailView.swift file (remove the second navigation view):
var body: some View {
VStack {
Text("Detail View")
}
}