Instance Method


Ends the match while submitting all of the scores and achievements.


- (void)endMatchInTurnWithMatchData:(NSData *)matchData scores:(NSArray<GKScore *> *)scores achievements:(NSArray<GKAchievement *> *)achievements completionHandler:(void (^)(NSError *error))completionHandler;



A serialized blob of data reflecting the current state for the match. Do not pass nil as an argument.


An array of GKScore objects containing the final scores for every participant in the match.


An array of GKAchievement objects containing the achievements acquired by each participant in the match.


A block to be called after the scores are saved to the server.

The block receives the following parameters:


If an error occurred, this error object describes the error. If the operation was completed successfully, the value is nil.


When this method is called, it creates a new background task to handle the request. The method then returns control to your game. Later, when the task is complete, Game Kit calls your completion handler. The completion handler is always called on the main thread.

This method ends the current match and submits scores and achievements for all of the participants. The scores can submitted to multiple leaderboards. The GKTurnBasedMatchOutcome status must be set for each participant before calling this method.

See Also