I have an app with two defined views. I use NavigationView to move between them. I wanted the alert button to switch users back to Main Menu View and I have even found an answer, but after I used it, it produced the screen like this:
[![A 2 backs bug](https://i.stack.imgur.com/tCDTpm.png)](https://i.stack.imgur.com/tCDTpm.png)

How can I let my app navigate back to the main view from the secondary view in a better way?

The code for the second view (first is just a NavigationLink pointing to the second):

```
import SwiftUI

struct GameView: View {

    @State private var questionCounter = 1

    @State var userAnswer = ""

    @State private var alertTitle = ""

    @State private var gameOver = false
    @State private var menuNavigation = false

    var body: some View {
        NavigationView{
            ZStack{
                NavigationLink(destination:ContentView(), isActive: $menuNavigation){
                    Text("")
                }
            VStack{

                Text("Give the answer")
                TextField("Give it", text: $userAnswer)

                Button("Submit", action: answerQuestion)
            }
            .alert(isPresented: $gameOver) {
                Alert(title: Text(alertTitle),
                      dismissButton: Alert.Button.default(
                        Text("Back to menu"), action: {
                            menuNavigation.toggle()
                        }
                      )
                )
                }
            }
            }

            }

    func answerQuestion() {

        questionCounter += 1

        if questionCounter == 2 {
            gameOver.toggle()
            alertTitle = "Game Over"

        }

    }
}

```

Thanks for your help :)