Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS Swift 2.0 Basics Swift Operators Unary Operators

++ and -- Operator Removed in Swift 3

Xcode is giving me a yellow caution warning that the ++ and -- operator are being removed in Swift 3. Will this video be updated when Swift 3 comes out? Or will there be a new course for it. I was also wondering how I would implement this into my code with the += and -= operators. Would I change my code to be like this:

var levelScore = 0
levelScore = levelScore + 1

var totalScore = levelScore
totalScore += levelScore

While fooling around with the operator, that is what I have found that might work instead of:

var levelScore = 0
levelScore = levelScore + 1

var totalScore = levelScore
totalScore = ++levelScore

I am asking to double check to see if this first code block, could replace what the second code block does.

3 Answers

Zachary Kaufman
Zachary Kaufman
1,463 Points

They will either change or replace the videos eventually to fit with Swift 3. So any personal projects you do, I'd suggest using += or -= but in Treehouse, until the videos say Swift 3, use Swift 2 syntax (++ and --) I hope this helps! Good luck with your classes

Steven Beckham
Steven Beckham
2,010 Points

I contacted Treehouse a few days ago to ask the same question and was told they don't currently have a Swift 3.0 update in their pipeline but will do it eventually based on interest from customers/students. I'd recommend sending them an e-mail to let them know you'd like to see an update. There are several changes like this as you move further along in the program and while they're relatively easy to fix it just makes it more confusing for a beginning developer (like myself).

Well thanks for telling me that information guys. I will just continue to use what the videos have told me to do until a update for the Swift track comes out.