title: How can I dismiss a ViewController from my GameScene.swift?
body: <p><strong>QUESTION:</strong> How can I dismiss a ViewController from my GameScene.swift ?</p>
  
  <hr>
  
  <p><strong>SITUTATION:</strong> I have 2 VCs in my SpriteKit Game, like so:</p>
  
  <p>ViewController.swift ----Press Play----->  GameViewController</p>
  
  <p>When the player loses, I want to dismiss the GameViewController so the player can press play again. I check for the player's loss in my GameScene.swift and would like to dismiss the GameVC from there.</p>
  
  <hr>
  
  <p><strong>N.B.:</strong> Googled this without success.</p>
  
  <hr>
  
  <p><strong>WHAT I TRIED:</strong></p>
  
  <p>1) Creating a gameVC instance in my GameScene.swift and dismissing it like so:</p>
  
  <pre><code>let gameVC = GameViewController()
  gameVC.dismissViewController(false,completion: nil)
  </code></pre>
  
  <p>2) Doing: </p>
  
  <p><code>self.view.window!.rootViewController?.dismissViewControllerAnimated(false, completion: nil)</code></p>
  
  <p>Those don't work for obvious reasons ^^</p>