title: Removing ViewController after performing segue
body: <p>I am making an iOS game application in Xcode and I perform a segue programmatically when a timer hits the end, as shown in the following code:</p>
  
  <pre><code> let endGame = DispatchTime.now() + 10
      DispatchQueue.main.asyncAfter(deadline: endGame) {
          print("The game has ended")
           self.performSegue(withIdentifier: "timerSegue", sender: self)
      }
  </code></pre>
  
  <p>My problem is that when the segue is already performed and I'm in the next screen I can hear sounds that reveal that the previous screen is still up and running and I want a way to remove it or delete it completely since the app is never going back to that view.</p>