I have a menu / data entry system that prsents teh following screens:
HomeView -> Page1 -> Page2 -> Page3
On Page 3 the use can commit or cancel both buttons shoule return to the Home screen....
The Home View decalres itself as s NavigationView
and then uses the followin menchanism to link to the child pages:
struct NavigationBarLink<V: View, T: Hashable> : View {
@EnvironmentObject var screenCoordinator: ScreenCoordinator
var destination: V
var tag: T
var active: Bool
@Binding var selection : T?
var body: some View {
ZStack {
NavigationLink(destination: destination,
tag: tag,
selection: $selection) {
EmptyView()
}.hidden().frame(height: 0)
Button("Next") {
self.selection = self.tag
}.disabled(!active)
}
}
}
This allows me to jump back to the first linked view (i.e.Page1
) but I cannot jump back to the HomeView
. Is there a way to unwind the full NavigationStack?
I have also noticed that if the HomeView
is a Form
and the NavigationLink to Page1 is within the form the layout of the child Views is corrupted - I guess this is yet another SwiftUI bug.
Over the past month I have come to realise that SwiftUI needs a huge amount of development before it can be used in a large project.
Is there a site that has a list of the known SwiftUI bugs and worlarounds - it would be nice to know as I have wasted far too much time solving issues with the Framework