Swift syntax for GKMatchmaker.matchForInvite

161 Views Asked by At

Does somebody know how to write Game Center invitation handling correctly? I cannot figure out the right syntax for this line:

GKMatchmaker.matchForInvite (Invitation:GKInvite!, completionHandler .....

Please help, I am stuck!

1

There are 1 best solutions below

0
On BEST ANSWER

I know this is an old question but I just came across it and thought i'd offer my two cents.

this is how i implemented that function

GKMatchmaker.sharedMatchmaker().matchForInvite(invite, completionHandler: { (match: GKMatch!, error: NSError!) -> Void in

   if error != nil {
      // error out
   }

   if match != nil {

      // success   
   }
 })