'++' is deprecated: it will be removed in Swift 3

2

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.

    
asked by M123456M 07.10.2016 в 17:17
source

2 answers

1

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
    
answered by 07.10.2016 / 17:59
source
1

++ was deprecated in Swift 3, the solution I see for that line is as follows:

column = column >= (numberOfColumns - 1) ? 0 : column+1
    
answered by 07.10.2016 в 17:49