-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
Can Help be used with NavigationStack within TabView? I'm struggling to understand, how to wire up the state of the stack to the helm.
Here is modified sample project that showcases what I want to do:
The Clips view has NavigationStack with "path" state that I would like to control with Help somehow.
`
struct TabExampleView: View {
@EnvironmentObject private var _helm: Helm
var body: some View {
VStack {
if let error = _helm.errors.last {
Text("Error: \(error.localizedDescription)")
.foregroundColor(.red)
.padding()
}
TabView(selection: _helm.pickPresented([.users, .clips, .more])) {
Text("Users view")
.tabItem {
Image(systemName: "person.circle.fill")
Text("Users")
}
.tag(Optional.some(Screen.users))
ClipsView()
.tabItem {
Image(systemName: "paperclip.circle.fill")
Text("Clips")
}
.tag(Optional.some(Screen.clips))
Text("More view")
.tabItem {
Image(systemName: "ellipsis")
Text("More")
}
.tag(Optional.some(Screen.more))
}
}
}
}
struct ClipsView: View {
@EnvironmentObject private var _helm: Helm
@State private var path: [String] = []
var body: some View {
NavigationStack(path: $path) {
List {
NavigationLink(value: "detail") {
Text("Detail")
}
}
.navigationDestination(for: String.self) { str in
Text(str)
}
}
}
}
`
Thank you for any help
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels