match(for:completionHandler:)
Creates a match from an invitation that the local player accepts.
Declaration
func match(for invite: GKInvite, completionHandler: (@Sendable (GKMatch?, (any Error)?) -> Void)? = nil)func match(for invite: GKInvite) async throws -> GKMatchParameters
- invite:
The invitation that the local player accepts.
- completionHandler:
The block that GameKit calls when it completes the request.
This block receives the following parameters:
matchThe match that GameKit creates when the local player accepts the invitation. If unsuccessful, this parameter is
nil.errorDescribes an error if one occurs, or
nilif the operation completes.
Discussion
Use this method when you implement your own interface to inform you when the local player joins a match.