title: Building a SpriteKit/GameKit leaderboard within a specific scene
body: <p>I'm pretty new to Swift and I'm having some trouble implementing a leaderboard into my game. I just watched a tutorial: 'Game Center Leaderboards! (Swift 2 in Xcode)' in which the GameCenter information all went through the one view of the app. In my game, I want the user to be able to play the game and then only when they are on a specific <code>SKScene</code> will they have access to GameCenter. </p>
  
  <p>So for example, on the <code>GameOverScene</code> will they be user authenticated and also will be able to upload their high score. I think I'm also missing some of the differences between the <code>GameViewController</code> (where all of the tutorials logic is located) and one of my many scenes that I've made. </p>
  
  <p>Here is my code in which I attempt to use the <code>GKGameCenterControllerDelegate</code> on the <code>GameOverScene</code> and create the various functions to reach GameCenter. The call is made when the user taps a certain label in the view: (this clearly doesnt work as I'm trying to access a scene on lines like this: <code>self.presentViewController(view!, animated:true, completion: nil)</code></p>
  
  <hr>
  
  <pre><code>class GameOverScene: SKScene, GKGameCenterControllerDelegate  {
  
      init(size: CGSize, theScore:Int) {
          score = theScore
          super.init(size: size)
      }
      ...
  
      override func didMoveToView(view: SKView) {
  
          authPlayer()
  
          leaderboardLabel.text = "Tap for Leaderboard"
          leaderboardLabel.fontSize = 12
          leaderboardLabel.fontColor = SKColor.redColor()
          leaderboardLabel.position = CGPoint(x: size.width*0.85, y: size.height*0.1)
          addChild(leaderboardLabel)
  
          ...
  
      override func touchesBegan(touches: Set&lt;UITouch&gt;, withEvent event: UIEvent?) {
  
          for touch : AnyObject in touches {
              let location = touch.locationInNode(self)
  
              if(CGRectContainsPoint(leaderBoardLabel.frame, location)){
                  saveHighScore(score)
                  showLeaderBoard()
              }
          }
      }
  
  
      func authPlayer(){
  
          //Create a play
          let localPlayer = GKLocalPlayer.localPlayer()
  
          //See if signed in or not
          localPlayer.authenticateHandler = {
              //A view controller and an error handler
              (view,error) in
  
              //If there is a view to work with
              if view != nil {
                  self.presentViewController(view!, animated:true, completion: nil) //we dont want a completion handler
              }
  
              else{
                  print(GKLocalPlayer.localPlayer().authenticated)
              }
          }
      }
  
  
      //Call this when ur highscore should be saved
      func saveHighScore(number:Int){
  
          if(GKLocalPlayer.localPlayer().authenticated){
  
              let scoreReporter = GKScore(leaderboardIdentifier: "scoreBoard")
              scoreReporter.value = Int64(number)
  
              let scoreArray: [GKScore] = [scoreReporter]
  
              GKScore.reportScores(scoreArray, withCompletionHandler: nil)
  
          }
  
      }
  
  
      func showLeaderBoard(){
  
          let viewController = self.view.window?.rootViewController
          let gcvc = GKGameCenterViewController()
  
          gcvc.gameCenterDelegate = self
  
          viewController?.presentViewController(gcvc, animated: true, completion: nil)
  
  
      }
  
  
      func gameCenterViewControllerDidFinish(gameCenterViewController: GKGameCenterViewController) {
          gameCenterViewController.dismissViewControllerAnimated(true, completion: nil)
      }
  </code></pre>
  
  <hr>
  
  <p>Any advice on how I could go about this would be great, I think that I may be getting the whole scene/view controller mixed up and its leading to problems. Thanks!</p>