In iOS 9 Apple deprecated the public func turnBasedMatchmakerViewController(_ viewController: GKTurnBasedMatchmakerViewController, didFind match: GKTurnBasedMatch)
method of the GKTurnBasedMatchmakerViewControllerDelegate
.
Apple's direction is to use the func player(_ player: GKPlayer, receivedTurnEventFor match: GKTurnBasedMatch, didBecomeActive: Bool)
method of GKLocalPlayerListener
.
Using only receivedTurnEventFor match
leads to the following scenario:
- User taps
+
which displays aGKTurnBasedMatchmakerViewController
. - User taps
Play Now
and Game Center will search for a match. - Game Center will return a match with empty
matchData
(a new match), or place the user into a match in progress — and the game is informed of this throughreceivedTurnEventFor match
.
While it is simple enough to determine if a new match has been created (using matchData
), there doesn't appear to be a way to determine if a match has been found vs a match being updated as all events flow through receivedTurnEventFor match
.
My question is this:
When using GKLocalPlayerListener
's receivedTurnEventFor match
method, is there a way to determine if the turn event is the result of a matchmaking find?