---
title: cancel()
framework: gamekit
role: symbol
role_heading: Instance Method
path: gamekit/gkmatchmaker/cancel()
---

# cancel()

Cancels a matchmaking request.

## Declaration

```swift
func cancel()
```

## Discussion

Discussion GameKit sends a GKError.Code.cancelled error to the completion handler of either the findMatch(for:withCompletionHandler:) or findPlayers(forHostedRequest:withCompletionHandler:) method.

## See Also

### Matching players

- [findMatch(for:withCompletionHandler:)](gamekit/gkmatchmaker/findmatch(for:withcompletionhandler:).md)
- [findPlayers(forHostedRequest:withCompletionHandler:)](gamekit/gkmatchmaker/findplayers(forhostedrequest:withcompletionhandler:).md)
- [findMatchedPlayers(_:withCompletionHandler:)](gamekit/gkmatchmaker/findmatchedplayers(_:withcompletionhandler:).md)
- [GKMatchedPlayers](gamekit/gkmatchedplayers.md)
- [addPlayers(to:matchRequest:completionHandler:)](gamekit/gkmatchmaker/addplayers(to:matchrequest:completionhandler:).md)
- [finishMatchmaking(for:)](gamekit/gkmatchmaker/finishmatchmaking(for:).md)
- [cancelPendingInvite(to:)](gamekit/gkmatchmaker/cancelpendinginvite(to:).md)
