This is a very simple iterated prisoner's dilemma game for two players, each playing on their own iOS device.
It is meant to demonstrate how to use Apple's Multipeer Connectivity framework, and accompanies this blog post.
- Clone this repo.
- Open the
.xcworkspace
file. - Run on two physical devices (the simulator often exhibits unexpeced behavior with the multipeer conectivity framework).
For the sake of making this example easier to follow along with, all game logic and non-boilerplate code is encapsulated in a single view controller. The Main.storyboard
file contains the layout of the game's single view, but all other logic lives in that file.
This project uses ReactiveCocoa. It's been set up via CocoaPods, but because the Pods folder is versioned you shouldn't need to worry about that other than needing to open the game's workspace file rather than its project file in Xcode.
MIT License. See the LICENSE file in this repo for details.