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

# match(_:player:didChange:)

Handles when a player connects or disconnects from a match.

## Declaration

```swift
optional func match(_ match: GKMatch, player playerID: String, didChange state: GKPlayerConnectionState)
```

## Parameters

- `match`: The match that the player is connected to.
- `playerID`: The identifier for the player whose state changed.
- `state`: The state the player moved to.

## Discussion

Discussion Implement this method to be notified when players connect to or disconnect from the match.

## See Also

### Deprecated Methods and Properties

- [match(_:didReceive:fromPlayer:)](gamekit/gkmatchdelegate/match(_:didreceive:fromplayer:).md)
- [match(_:shouldReinvitePlayer:)](gamekit/gkmatchdelegate/match(_:shouldreinviteplayer:).md)
