Are ++ and +=1 exactly the same?

No they aren't identical, you have to increment first, then return the value.try this.

func countingCounter() -> (() -> Int){
    var counter1 = 0
    let incrementCounter1: () -> Int = {
        counter1 += 1
        return counter1
    }
    return incrementCounter1
}

No, they aren't identical, ++ and -- increment (or decrement) and return, += and -= add (or subtract) an amount in a simple to read short form, but they don't return anything.

So, you need to separate the value change from the value usage. Which is the whole point of the deprecation really - to make your code easier to read and maintain.


As said in my comment here is how you have to write it now to replace the postfix ++. ANother way would be to use an intermediary variable if you don't like the -1 thing.

let incrementCounter1: () -> Int = {
    counter1+=1   //original is counter1++
    return counter1-1;
}

It clearly states in the Apple docs, copied here for your convenience:

NOTE

The compound assignment operators do not return a value. For example, you cannot write let b = a += 2.

No, the ++ operator is NOT the same as +=.