Swiftui Navigation to multiple views

Hey! this my first post here… i took a good steps in IOS development by SwiftUI framework … I got stuck in with navigation between views in navigation view here is the structure of my App…

going forward
using NavigationLink with binding boolean
Content View–>Second View–> Third View

Moving back
Third View–>Second View -->(i can’t go back from second view to the content view)

I am using custom back button in my second view with a binding variable to the content view so it goes back correctly only if i didn’t
move forward to the third view…

Once moved to third view i can move back to second view but tapping back on second view doesn’t move me to the content view any more , i think its about the state of the view.


//First View
@State var singleActive = false

NavigationLink(destination: Playerslist(ListisPresented: self.$singleActive), isActive: self.$singleActive){
Text("")
}

Second View

@Binding var ListisPresented : Bool

.navigationBarItems(leading: Button(action: {

            self.ListisPresented = false;
            
           // print("\(self.presentationMode.wrappedValue)")
               
            print("Back Button is Tapped")
        })

I hope its clear enough…

1 Like