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 Types String Manipulation

Colin Smith
Colin Smith
3,907 Points

Code works in swift. Bummer error in web console. Connectivity Issue?

I have compiled my code for the challenge successfully in Swift. However the code does not run in the web based console. Also sometimes I'm not able to get the preview to show me whatever error might have come up. Is there some kind of connection issue. Is there a preferred browser for this content? I'm using safari now.

strings.swift
// Enter your code below

let name = "Colin"
let greeting = "Hi there, \(name)."

let  finalGreeting = greeting + " How are you?"

2 Answers

Michael Hulet
Michael Hulet
47,913 Points

Your code is actually totally valid, and should pass the challenge. Great job! That being said, it seems like you've found a weird issue with the challenge parser. Like I said, you have total valid Swift that should work, but the challenge checker gets thrown off by there being 2 spaces between let and finalGreeting. The Swift compiler will happily compile that, but for some reason, the challenge fails it. I've reported it as a bug, but in the meantime, if you remove one of those spaces, your code passes the challenge on my machine

Colin Smith
Colin Smith
3,907 Points

OMG thank you! that was driving me crazy :P