-1

I have a project with NavigationLink that leads a login screen into a main menu which is intended, but there is a back button that leads back to the login screen which I want to get rid of. How would I do so?

sizzyd
  • 1
  • 1

1 Answers1

0

Under the view that you are presenting in the main menu, for instance:

var body: some View {
    MyView()
        .navigationBarBackButtonHidden()
}

if you have a more complicated view, you can also put it under the layout container, like:

var body: some View {
    HStack {
        // Your views
    }
    .navigationBarBackButtonHidden()
}

Your back button should be gone then.

halfer
  • 19,824
  • 17
  • 99
  • 186
MacUserT
  • 1,760
  • 2
  • 18
  • 30