title: Swift segue to another View Controller in function
body: <p>Hi I have tried numerous times to segue to another view controller via the use of tutorials but they don't work. Please can someone give me clear instructions on how to setup and call a segue to my next view controller. bear in mind the code for this will not be in the current view controller class.</p>
  
  <p>the function runs when my player dies and so i want another view controller to appear. The function is:</p>
  
  <pre><code> func playerHitSquare(player:SKSpriteNode, level1: Enemy){
  
      timer.invalidate()
      removeAllChildren()
  }
  </code></pre>
  
  <p>The View controller i want to go to is called FinishViewController with the identifier Finish and the current view is GameViewController.</p>