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

Popular posts from this blog

PHP DOM loadHTML() method unusual warning -

python - How to create jsonb index using GIN on SQLAlchemy? -

c# - TransactionScope not rolling back although no complete() is called -