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

Unary Operators 3 mins in ++levelScore is no go!!

Because I am learning Swift 2 rather than Swift 3 I am unable to do the ++levelScore code because I get an error stating this has been removed from Swift 3.

Whats the point in continuing this course if I am certain there will be more issues like this as I go along? Should I research every time I run into this sort of issue and try to implement Swift 3 syntax? (What I will attempt to do anyway)

so ++ was completely removed from Swift 3 and I am using the newest version of Xcode and Swift 3 per an Apple Update!!

So in this case I just keep going? Hoping I don't get stuck soon....

1 Answer

Simon Di Giovanni
Simon Di Giovanni
8,429 Points

Hi Gerardo

I don't think there will be many problems at all.

When they update Xcode it's always improving. Anything you learn for Swift 2 will be all 99% still correct in Swift 3.

There may be minor differences like what you described, as in ++levelscore longer exists. You now would just simply use levelscore += 1.

As you can see, the functionality is still there, it's just a simple syntax change.

Cheers

Simon