O'Reilly logo

Beginning iOS Game Center and Game Kit: For iPhone, iPad, and iPod touch by Kyle Richter

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Presenting a Peer Picker

We will begin, as we have in the past, by adding a new button for our Peer Picker in our UFOViewController.xib, as shown in Figure 6–4. Create a new action for the button and name it localMultiplayerGameButtonPressed. In addition, you need to create two new class variables, one instance of GKPeerPickerController and another for a GKSession. Name these peerPickerController and currentSession, respectively. You also need to conform the UFOViewController to the delegate GKPeerPickerControllerDelegate.

image

Figure 6–4. Adding a button for a local multiplayer game

Add the following code to the action that you created for the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required