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 Basics Swift Operators Working With Operators: Part 2

Can't get challenge 2 of 2 to compile without Bummer error for exercise but compiles fine in my Playgrounds, Why?

When I click preview to see the errors causing my code to fail it will not display the compiler errors.

Here is my simple code;

// Enter your code below

var initialScore = 8 initialScore += 1

let isWinner = initialScore isWinner

operators.swift
// Enter your code below

var initialScore = 8
initialScore += 1

let isWinner = initialScore
isWinner != 10
Geoff Lambert
Geoff Lambert
17,106 Points

Your appear to be adding the value of initialScore to isWinner. What they want is a true or false value for isWinner, and you currently have the integer 9. Try adding your isWinner != 10 directly into the constant declaration above.

2 Answers

Thank you Geoff and Jeff for clarifying this for me. Makes perfect sense now. I am able to move on from this challenge.

Jeff McDivitt
Jeff McDivitt
23,970 Points

Hi Tom

You are really close here you just need to basically combine the last two lines that you have in your code (Eliminating the second isWinner of course). Let me know if it makes sense

var initialScore = 8
initialScore += 1
let isWinner = initialScore != 10