<!--
{
  "availability" : [
    "iOS: 4.1.0 -",
    "iPadOS: 4.1.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.8.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "GameKit",
  "identifier" : "/documentation/GameKit/GKMatchDelegate/match(_:player:didChange:)-8ohgr",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "GameKit"
    ],
    "preciseIdentifier" : "c:objc(pl)GKMatchDelegate(im)match:player:didChangeConnectionState:"
  },
  "title" : "match(_:player:didChange:)"
}
-->

# match(_:player:didChange:)

Handles when players connect or disconnect from a match.

```
optional func match(_ match: GKMatch, player: GKPlayer, didChange state: GKPlayerConnectionState)
```

## Parameters

`match`

The match joined by the player.

`player`

The player whose state changed.

`state`

The state of the player in the match.

## Discussion

If the match’s [`expectedPlayerCount`](/documentation/GameKit/GKMatch/expectedPlayerCount) property is `0` when GameKit invokes this method, you can start the game. If two or more players join the match, you can begin data and voice communication.

---

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)