<!--
{
  "availability" : [
    "iOS: 5.0.0 -",
    "iPadOS: 5.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.8.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "GameKit",
  "identifier" : "/documentation/GameKit/GKTurnBasedMatchmakerViewController",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "GameKit"
    ],
    "preciseIdentifier" : "c:objc(cs)GKTurnBasedMatchmakerViewController"
  },
  "title" : "GKTurnBasedMatchmakerViewController"
}
-->

# GKTurnBasedMatchmakerViewController

An interface that allows a player to invite other players to a turn-based match and automatch to fill any empty slots.

```
class GKTurnBasedMatchmakerViewController
```

## Overview

Before you create a `GKTurnBasedMatchmakerViewController` object, create a [`GKMatchRequest`](/documentation/GameKit/GKMatchRequest) object and configure it according to the parameters of your game. Then, pass the match request to the [`init(matchRequest:)`](/documentation/GameKit/GKMatchmakerViewController/init(matchRequest:)) initializer to create the view controller.

Configure the view controller and set its delegate before you present it to the local player. The view controller allows the local player to choose other players and optionally fill empty slots using automatch. The interface also allows players to select an existing match, forfeit a match, or view a completed match.

Implement the [`GKTurnBasedMatchmakerViewControllerDelegate`](/documentation/GameKit/GKTurnBasedMatchmakerViewControllerDelegate) protocol to handle when a player selects players, cancels matchmaking, or encounters an error. Implement the [`turnBasedMatchmakerViewController(_:didFind:)`](/documentation/GameKit/GKTurnBasedMatchmakerViewControllerDelegate/turnBasedMatchmakerViewController(_:didFind:)) delegate method to dismiss the view controller when the local player invites players.

Register as a listener of the [`GKLocalPlayerListener`](/documentation/GameKit/GKLocalPlayerListener) protocol and implement [`GKTurnBasedEventListener`](/documentation/GameKit/GKTurnBasedEventListener) methods that handle other turn-based events. For example, implement the [`player(_:receivedTurnEventFor:didBecomeActive:)`](/documentation/GameKit/GKTurnBasedEventListener/player(_:receivedTurnEventFor:didBecomeActive:)) to update match data and present the gameplay interface for the local player to take their turn.

In iOS, you present and dismiss the view controller from another view controller in your game, using the methods provided by the <doc://com.apple.documentation/documentation/UIKit/UIViewController> class. If you use SwiftUI, you can get the root view controller from the <doc://com.apple.documentation/documentation/UIKit/UIApplication> object. In macOS, you use the [`GKDialogController`](/documentation/GameKit/GKDialogController) class to present and dismiss the view controller.

## Topics

### Creating and Configuring the View Controller

[`-  initWithMatchRequest:`](/documentation/GameKit/GKTurnBasedMatchmakerViewController/init(matchRequest:))

Creates a matchmaker view controller for the local player to start inviting other players to a turn-based game.

[`showExistingMatches`](/documentation/GameKit/GKTurnBasedMatchmakerViewController/showExistingMatches)

A Boolean value that determines whether the view controller shows existing matches.

[`matchmakingMode`](/documentation/GameKit/GKTurnBasedMatchmakerViewController/matchmakingMode)

The mode that a multiplayer game uses to find players.

[`GKMatchmakingMode`](/documentation/GameKit/GKMatchmakingMode)

Possible modes that a multiplayer game uses to find matches.

### Setting the Delegate

[`turnBasedMatchmakerDelegate`](/documentation/GameKit/GKTurnBasedMatchmakerViewController/turnBasedMatchmakerDelegate)

The object that handles turn-based matchmaker view controller changes.

[`GKTurnBasedMatchmakerViewControllerDelegate`](/documentation/GameKit/GKTurnBasedMatchmakerViewControllerDelegate)

A protocol that handles when the status of turn-based matchmaking changes.

## Relationships

### Conforms To

[`CVarArg`](/documentation/Swift/CVarArg)

[`Equatable`](/documentation/Swift/Equatable)

[`UIActivityItemsConfigurationProviding`](/documentation/UIKit/UIActivityItemsConfigurationProviding)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`UITraitChangeObservable-67e94`](/documentation/UIKit/UITraitChangeObservable-67e94)

[`NSExtensionRequestHandling`](/documentation/Foundation/NSExtensionRequestHandling)

[`NSStandardKeyBindingResponding`](/documentation/AppKit/NSStandardKeyBindingResponding)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`NSCoding`](/documentation/Foundation/NSCoding)

[`UIPasteConfigurationSupporting`](/documentation/UIKit/UIPasteConfigurationSupporting)

[`NSUserActivityRestoring`](/documentation/AppKit/NSUserActivityRestoring)

[`UIFocusEnvironment`](/documentation/UIKit/UIFocusEnvironment)

[`UIStateRestoring`](/documentation/UIKit/UIStateRestoring)

[`UIContentContainer`](/documentation/UIKit/UIContentContainer)

[`Hashable`](/documentation/Swift/Hashable)

[`NSUserInterfaceItemIdentification`](/documentation/AppKit/NSUserInterfaceItemIdentification)

[`UIResponderStandardEditActions`](/documentation/UIKit/UIResponderStandardEditActions)

[`NSSeguePerforming`](/documentation/AppKit/NSSeguePerforming)

[`NSTouchBarProvider`](/documentation/AppKit/NSTouchBarProvider)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`GKViewController`](/documentation/GameKit/GKViewController)

[`UIUserActivityRestoring`](/documentation/UIKit/UIUserActivityRestoring)

[`UITraitEnvironment`](/documentation/UIKit/UITraitEnvironment)

[`NSEditor`](/documentation/AppKit/NSEditor)

[`Sendable`](/documentation/Swift/Sendable)

[`UIAppearanceContainer`](/documentation/UIKit/UIAppearanceContainer)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

### Inherits From

[`NSViewController`](/documentation/AppKit/NSViewController)

[`UINavigationController`](/documentation/UIKit/UINavigationController)

---

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)