Hi all,
I'm very new to iOS development. GKTurnBasedMatchmaking makes no sense to me, and I'm having a real hard time figuring out based off the docs.
Here's what I'm currently doing:
- Authenticate the player
- Make my GameScene a GKTurnBasedMatchmakingViewControllerDelegate
- Present the GKTurnBasedMatchmakingViewController like so:
func makeMatch(){
if(!gcEnabled){ return; }
self.match.minPlayers = 2;
self.match.maxPlayers = 2;
self.match.defaultNumberOfPlayers = 2;
let mmVC = GKTurnBasedMatchmakerViewController(matchRequest: match);
mmVC.turnBasedMatchmakerDelegate = self;
self.view?.window?.rootViewController?.present(mmVC, animated: true, completion: nil);
}
I have no idea what to do after that. My intuition was that there'd be some kind of 'didFindMatch' callback to execute once a match has filled in all the players, but that appears to be deprecated.
How do I know when Game Center has found all the required auto-match players?
How come GKTurnBasedMatchmakerViewController seems to always create a new match? Shouldn't it join an existing matchmaker request if there is one?