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 -> GKTurnBasedMatchParameters
- 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
matchIDidentifier, ornilif an error occurs.- error
Describes an error if it occurs, or
nilif 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.