Created
August 6, 2018 06:49
-
-
Save BeauNouvelle/b1e4f8fb5a585433d299469e3aeff4f0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for cell in world.cells { | |
let rect = CGRect(x: cell.x * cellSize, y: cell.y * cellSize, width: cellSize, height: cellSize) | |
let color = cell.state == .alive ? UIColor.green.cgColor : UIColor.white.cgColor | |
context?.addRect(rect) | |
context?.setFillColor(color) | |
context?.fill(rect) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment