<!--
{
  "availability" : [
    "iOS: 6.0.0 -",
    "iPadOS: 6.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.9.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "GameKit",
  "identifier" : "/documentation/GameKit/GKMatchmaker/match(for:completionHandler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "GameKit"
    ],
    "preciseIdentifier" : "c:objc(cs)GKMatchmaker(im)matchForInvite:completionHandler:"
  },
  "title" : "match(for:completionHandler:)"
}
-->

# match(for:completionHandler:)

Creates a match from an invitation that the local player accepts.

```
func match(for invite: GKInvite, completionHandler: (@Sendable (GKMatch?, (any Error)?) -> Void)? = nil)
```

## Parameters

`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:

- `match`: The match that GameKit creates when the local player accepts the invitation. If unsuccessful, this parameter is `nil`.
- `error`: Describes an error if one occurs, or `nil` if the operation completes.

## Discussion

Use this method when you implement your own interface to inform you when the local player joins a match.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)