Contents

loadMatchData(completionHandler:)

Fetches your game-specific data that you store in Game Center when ending a turn, saving a turn, or leaving a match.

Declaration

func loadMatchData(completionHandler: (@Sendable (Data?, (any Error)?) -> Void)? = nil)
func loadMatchData() async throws -> Data?

Parameters

  • completionHandler:

    The block that GameKit calls when it completes the request.

    The block receives the following parameters:

    matchData

    The match data you pass to GKTurnBasedMatch methods that GameKit stores in Game Center, or nil if an error occurs.

    error

    Describes an error if it occurs, or nil if the operation completes.

Discussion

The matchData property is nil until you fetch the data from Game Center using this method.

See Also

Retrieving Match Details