- iOS 12 Programming for Beginners
- Craig Clayton
- 69字
- 2021-07-02 15:04:54
Increment and decrement
There are times when you need to increment (increase) or decrement (decrease) a value. There are two ways you can accomplish this. Add the following into Playgrounds:

Both of these options do the same thing, but option #2 is in shorthand. The preferred way is to use option #2, which is += (addition assignment operator) and −= (subtraction assignment operator), but the choice is yours.