title: How can I access the previous view controller from an SKScene, when it's not the rootviewcontroller and there is no navigation controller?
body: <p>I have a CollectionViewController -> GameViewController -> SKScene</p>
  
  <p>In the skscene, I'm trying to show a game center leaderboard with this block of code:</p>
  
  <pre><code>var gcVC: GKGameCenterViewController = GKGameCenterViewController()
      gcVC.gameCenterDelegate = self
      gcVC.viewState = GKGameCenterViewControllerState.leaderboards
      gcVC.leaderboardIdentifier = "leaderboardID"
      self.view?.window?.rootViewController?.present(gcVC, animated: true, completion: nil)
  </code></pre>
  
  <p>The error i get is:</p>
  
  <p>2018-07-14 21:29:15.409830-0400 AppName [5266:1674334] Warning: Attempt to present  on  whose view is not in the window hierarchy!</p>
  
  <p>If the initial view is the collectionviewcontroller, it doesn't work. If its the gameviewcontroller, it does. </p>
  
  <p>I think i need to have the gameviewcontroller present the leaderboard, but i don't know how to access it. </p>
  
  <p>(Keep in mind, the gameviewcontroller is not the rootviewcontroller and there is no navigation controller)</p>
  
  <p>Any help is appreciated!</p>