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

How to connect android app to App engine -

gcc - MinGW's ld cannot perform PE operations on non PE output file -

php - display validation error message next to the textbox in codeigniter -