Conway's Game of Life in Swift 2.0 and SpriteKit

Published 3 July 2015

Coding in Xcode 7?

If you are able to compile Swift 2.0 in Xcode 7 or higher, the files below are pretty much all you need.

  1. Create a new SpriteKit project for either iOS or Mac
  2. Create the files below
  3. include the following line at the end of the ViewController setup: 
         scene.setLife()
  4. Define the type alias RMColor based on whether you are developing for Mac of iOS: 
         typealias RMColor = NSColor (iOS) / UIColor (Mac)

Max OS X

Swift / SpriteKit

[

Download
](https://github.com/maxbilbow/GameOfLife/releases/tag/v0.1.1)

Android

Unity

[

Download
](https://github.com/maxbilbow/GameOfLife/releases/tag/v0.1.1)

’);
-->

The Life.Swift file was translated from the example available on golang.org.

[gist id=6be9b5f46d54e5aa7464]