How do I end a game once a condition has been met?

I’m making a battleship game on Xcode 11 using Storyboards, and I’ve pretty much done everything except a Game Over screen and stop registering the guesses once the counter reaches 0. This is also my first time making a game on my own. Here’s one of the IBActions I made for the buttons:

 @IBAction func square1Button(_ sender: Any) {
        if randomNum == 1 {
            square1.image = UIImage(named: "ShipPatrolHull")
        } else {
            guesses -= 1
            Turns.text = String(guesses)
            if guesses == 0 {

The if statement in the else statement is empty because I don’t know what to add there to make the variable guesses stop going down and to make a Game Over screen to show. I made another storyboard called GameOver, but I don’t know how to add anything to it, or how to change which storyboard the user sees based on the game ending.

Once your guesses have reached 0, like your if statement says.

You can instantiate a new storyboard view controller (this will display it on the screen)

And on that you can show whatever stats you want