I am migrating a class to Swift 3 and it shows me the error: '++' is deprecated: it will be removed in Swift 3.
This is the code:
column = column >= (numberOfColumns - 1) ? 0 : ++column
The problem is in ++ column.
I am migrating a class to Swift 3 and it shows me the error: '++' is deprecated: it will be removed in Swift 3.
This is the code:
column = column >= (numberOfColumns - 1) ? 0 : ++column
The problem is in ++ column.
It is correct, the operator ++
can not be used anymore. In your case, anyway, you did not need it ...
First you were increasing the value of column
by doing ++column
, and then you were assigning that value to the variable column
(which had no effect).
You should write it like this:
column = column >= (numberOfColumns - 1) ? 0 : column+1
++
was deprecated in Swift 3, the solution I see for that line is as follows:
column = column >= (numberOfColumns - 1) ? 0 : column+1