Request a Turn-Based Match

Apple Game Frameworks and Technologies — by Tammy Coron (161 / 193)

The Pragmatic Programmers
The Pragmatic Programmers

--

👈 Chapter 17 Creating Multiplayer Games with GameKit | TOC | Manage Multiplayer Matches 👉

Before your players can start or join a multiplayer Game Center game, they first need to make a request. To set up a multiplayer game request, you can use the GKTurnBasedMatchmakerViewController class and its corresponding GKTurnBasedMatchmakerViewControllerDelegate protocol. You can also create a custom match controller, but that goes beyond the scope of this book, so you’ll stick with the standard matchmaking UI.

The GKTurnBasedMatchmakerViewController class is responsible for showing the standard interface where players can manage their multiplayer games. To present this view controller, you’ll use another custom notification, similar to what you created in the previous chapter.

Preparing for the Turn-Based Matchmaker View Controller

Open the hog project in Xcode.

Using the Starter Project

You may continue using your project from the previous chapter, or you can use the starter project located in the projects/begin folder included with the code resources for this chapter. Either option is fine; the only benefit to using the starter project is that you won’t get stuck going forward if you missed an earlier step.

--

--

The Pragmatic Programmers
The Pragmatic Programmers

We create timely, practical books and learning resources on classic and cutting-edge topics to help you practice your craft and accelerate your career.