title: how to write Invitehandler for iOS 9 Xcode 7 beta 6
body: <p>I am trying to develop a simple multiplayer game. As instructed in the Apple doc I am implementing the invite handler "matchforinvite" so that I could accept invite from other players. 
  <a href="https://developer.apple.com/library/ios/documentation/GameKit/Reference/GKMatchmaker_Ref/#//apple_ref/occ/instm/GKMatchmaker/matchForInvite:completionHandler:" rel="nofollow">https://developer.apple.com/library/ios/documentation/GameKit/Reference/GKMatchmaker_Ref/#//apple_ref/occ/instm/GKMatchmaker/matchForInvite:completionHandler:</a></p>
  
  <p>I am doing this via the following function</p>
  
  <pre><code>func setUpInviteHandler() {
  
      GKMatchmaker.sharedMatchmaker().matchForInvite(invite: GKInvite, completionHandler: { match, error -&gt; Void in
          if invite.playerAttributes != 0 {
              print(invite.playerAttributes)
          }
      })
  
  }
  </code></pre>
  
  <p>however, no matter how i change it there is always error from Xcode. How could I fix it?</p>
  
  <p>The problem here (i guess) is that the GKInvite object never exist until there is an invite. However, when you do a function like this, the GKInvite thing has to be initialized in order to be called. How could you initialize a runtime object? The worst is i cannot do !(GKInvite) or GKInvite == nil checking because of the class type. Can anyone help?</p>