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 Working With Operators

Ben Gold
Ben Gold
807 Points

Problem with Challenge Task 2 How do I assign the Boolean value of the comparison to constant isGreater?

I'm doing as follows for Task 2:

someOperation >= anotherOperation let isGreater = true

What am I doing wrong? I've tried other ideas.

Lamar Greene
Lamar Greene
9,581 Points

Please provide a link to the challenge, or post the original question and code snippet so there is detail/context of what the actual question is. (see the markdown cheatsheet below the "add comment" or "add an answer" section on how to post code snippets.)

2 Answers

Hi Ben,

You should do it like this: let isGreater = someOperation >= anotherOperation

The comparison between someOperation and anotherOperation will automatically result a Boolean value (true/false) that value is then assigned to isGreater constant.

Cheers, Safwat

Ben Gold
Ben Gold
807 Points

Hi Safwat,

Thanks for getting back to me! I actually figured it out in the meantime, but couldn't find my own post to let everyone know.