This code passes 3 as an argument to the arc4random_uniform()
function and I guess that it returns true or false. Next you assign an enumerator to a variable. I don't understand what the function does, though.
let randomState = arc4random_uniform(3) == 2 ? CellState.Alive :
CellState.Empty
let cell = Cell(grid: self,
pos: (i, j),
state: randomState)
I am not following that logic.