ios - Swift Array Issues -
i have code:
let posstate = positionstate(pos) if posstate != .none { if posstate == .off { boardarray[pos.row][pos.column] == .on } else { boardarray[pos.row][pos.column] == .off } }
the issue i'm having when attempt change value of element in boardarray
, nothing happens. why boardarray's element stay same?
you using ==
rather =
assigning
let posstate = positionstate(pos) if posstate != .none { if posstate == .off { boardarray[pos.row][pos.column] = .on } else { boardarray[pos.row][pos.column] = .off } }
Comments
Post a Comment