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 Assignment and Comparison

Michaล‚ Gonciarz
Michaล‚ Gonciarz
13,549 Points

Is it a Xcode bug?

Hi!

Does someone have an idea why Xcode seems to stop working when a result of an operator is false, but not in a way it returns "false", but in a logic sense if I can put it that way. For example, when I wrote:

let string1 = "Hello!"
let string2 = "Hello!"
let srting3 = "hello"

I get these results:

string1 == string2

true

string1 != string2

false

But when I changed them to:

string1 == string3

or

string1 != string3

the results on the preview fades and it seems to turn off any of another results in the preview. Have anybody faced similar problems with Xcode?

Art Hayes
Art Hayes
7,251 Points

You spelled 'string' wrong in 'string3' in your declaration.

It should work fine after that. :)