title: Attempt to present ViewController whose view is not in the windows hierarchy
body: <p>I meet a strange problem: I made 2 view controllers for wich I can switch the view with code:</p>
  
  <pre><code>var currentViewController:UIViewController=UIApplication.shared.keyWindow!.rootViewController!
  
  func showController()
  {
      let ViewControllernew1 = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "viewController2")
  
      currentViewController.present(ViewControllernew1, animated: true, completion: nil)
  
  }
  </code></pre>
  
  <p>My app open correctly to the first view controller, then, when I click on the button created on a sprite kit scene, I can switch the view to my new view controller successfully (I get my second scene successfully showed) but then, I can not change anymore my view controller after this switch. If I click again on the button, I get this message:</p>
  
  <p>Attempt to present  on Test_Vuforia.GameViewController: 0x12f549610 whose view is not in the window hierarchy!</p>
  
  <p>Do you know what is the problem ? I understand I'm in the root position so that I can not change anymore my view controller after having switched it, but how to change that ?</p>
  
  <p>Thanks !</p>
  
  <p>Edit:</p>
  
  <p>My code is used inside a SKScene and not from a UIVewController and I get this error when I use the suffix self. : Value of type View (SKScene) has no member 'present'.</p>
  
  <p>I'm creating an augmented reality game with Vuforia and I need to switch AR view with SKScene.</p>