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!
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

Paul Neuhaus
1,518 PointsProblem with code challenge in Build a Simple iPhone App with Swift 3...
I get the "Bummer" warning when I turn in my answer for this one. It says I have compiler errors, but no errors show in the preview window or in a Swift Playground. What am I doing wrong?
Here's the code challenge...
Here's a screenshot...
Thanks in advance!
3 Answers

Paul Neuhaus
1,518 PointsThanks for your reply, Katherine.
You were right about my Left and Right switch statements being reversed. I thought that might be the problem, but I still get "Bummer".
I did remove " _" in front of direction but that's because the program won't compile with that space-underscore present. The switch statement doesn't read as a switch statement with those extra characters in there. I've tried it both ways. If I use the " _" I get numerous compiler errors. If I do it without, I get the "Bummer" message, but Preview window is empty, giving me no indication of what I've done wrong.

Paul Neuhaus
1,518 PointsI restarted the challenge and used your code. It worked.
I'm baffled as to what went wrong, but now I'm out of the woods.
Thanks, Katherine.

Katherine Ebel
43,799 PointsGlad you got it working!

Katherine Ebel
43,799 PointsI notice a couple things in your screen shot. Did you change the method signatures on the move method? When I load the code challenge it shows an ' _' in front of the direction parameter in the move method, but it is not showing on your screen shot. Also.... it looks like you might have your case statements for right and left backwards.You are increasing location.x on left and decreasing on right. I think that is supposed to be the other way...
Katherine Ebel
43,799 PointsKatherine Ebel
43,799 PointsHmm...I passed the challenge only changing the left and right case statements, and leaving the argument labels in the function definition. Taking that out could cause problems with how treehouse is testing your code. Adding the
_
means you don't need to add the argument label when calling the function. If you take it out you would need to writerobot.move(direction: "Up")
to call the function. Hopefully I am making sense :) There must be some other syntax error in your code. This code just passed for me...