Contents

load(withID:withCompletionHandler:)

Loads a specific match with the specified identifier.

Declaration

class func load(withID matchID: String, withCompletionHandler completionHandler: (@Sendable (GKTurnBasedMatch?, (any Error)?) -> Void)? = nil)
class func load(withID matchID: String) async throws -> GKTurnBasedMatch

Parameters

  • matchID:

    The identifier for the turn-based match.

  • completionHandler:

    The block that GameKit calls when it completes the request.

    The block receives the following parameters:

    match

    The local player’s match with the matchID identifier, or nil if an error occurs.

    error

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

Discussion

The matchData property of the match object is nil until you fetch the data from Game Center using the loadMatchData(completionHandler:) method.

See Also

Loading Existing Matches