---
title: "player(_:matchEnded:)"
framework: gamekit
role: symbol
role_heading: Instance Method
path: "gamekit/gkturnbasedeventlistener/player(_:matchended:)"
---

# player(_:matchEnded:)

Handles when the match ends.

## Declaration

```swift
optional func player(_ player: GKPlayer, matchEnded match: GKTurnBasedMatch)
```

## Parameters

- `player`: The player who receives this turn-based event.
- `match`: The match that ends.

## Mentioned in

Starting turn-based matches and passing turns between players

## Discussion

Discussion Implement this method to stop gameplay, notify the player that the match is over, and show the participant outcomes.

## See Also

### Handling Match-Related Events

- [player(_:receivedTurnEventFor:didBecomeActive:)](gamekit/gkturnbasedeventlistener/player(_:receivedturneventfor:didbecomeactive:).md)
- [player(_:didRequestMatchWithOtherPlayers:)](gamekit/gkturnbasedeventlistener/player(_:didrequestmatchwithotherplayers:).md)
- [player(_:wantsToQuitMatch:)](gamekit/gkturnbasedeventlistener/player(_:wantstoquitmatch:).md)
- [player(_:didRequestMatchWithPlayers:)](gamekit/gkturnbasedeventlistener/player(_:didrequestmatchwithplayers:).md)
