Skip to content

Error While Navigating From Double Column Navigation View #51

Answered by matteopuc
HaarisIqubal asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @HaarisIqubal. It would be great to have a minimum viable example to try and debug. If I got what you mean, I think the problem is that you are trying to use the navigation stack environment object from a completely different view hierarchy. What about having two different NavigationStackView? Something like:

struct ContentView: View {
    @StateObject var mainNavStack = NavigationStack()
    @StateObject var secondaryNavStack = NavigationStack()

    var body: some View {
        NavigationView {
            NavigationStackView(navigationStack: mainNavStack) {
                MainView()
            }
            NavigationStackView(navigationStack: secondaryNavStack) {
                S…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@HaarisIqubal
Comment options

@matteopuc
Comment options

Answer selected by HaarisIqubal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants