Instance Method


Saves the merged data for the current turn without ending the turn.


- (void)saveMergedMatchData:(NSData *)matchData withResolvedExchanges:(NSArray<GKTurnBasedExchange *> *)exchanges completionHandler:(void (^)(NSError *error))completionHandler;



A serialized blob of data reflecting the current state for the match.


An array of GKTurnBasedExchange objects that contains the resolved exchanges.


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.

When this method is called, the data sent is marked as being resolved. This means that the data has been merged into the match data. If other players currently have the game running, they will receive a handleTurnEventForMatch call to indicate that matchData has changed. All completed exchanges must be resolved before ending a turn. If the completed exchanges have not been resolved, then calling endTurn, participantQuitInTurnWithOutCome, or endMatchInTurn will result in an error.

See Also

Transferring Information with Exchanges


The exchange will timeout after one day if no reply is received.


The exchange will not timeout.


Returns the exchanges that are active for the local player.


The exchanges that have been completed and need to be merged by the local participant.


The maximum amount of data allowed for an exchange.


Limits the number of exchanges the player can have initiated at once.


The current exchanges that are in progress for the match.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software