---
title: "match(_:player:didChange:)"
framework: gamekit
role: symbol
role_heading: Instance Method
path: "gamekit/gkmatchdelegate/match(_:player:didchange:)-8ohgr"
---

# match(_:player:didChange:)

Handles when players connect or disconnect from a match.

## Declaration

```swift
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.

## Mentioned in

Finding multiple players for a game Exchanging data between players in real-time games

## Discussion

Discussion If the match’s 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.

## See Also

### Receiving State Notifications About Other Players

- [GKPlayerConnectionState](gamekit/gkplayerconnectionstate.md)
