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 (retired) Types Printing Results

Not getting this. You need to interpolate the value of the 'language' constant into the string you pass to 'println'.

When I perform this on Xcode, it works fine. Not sure why I am having significant difficulty here

3 Answers

Holt Hunter
Holt Hunter
4,629 Points

Hi Darryl,

You may be trying to do this:

let language = "Swift"

println("Learning " + language)

This would work in a normal script, but the code challenge wants you to use the more compact and simple way:

let language = "Swift"

println("Learning \(language)")

This is an easier way to use string interpolation than the first one, and the above is also what the code challenge wants you to use.

Hope this helps!

Thanks so much. Unfortunately id didn't work. Yet I understand now more of what interpolation is.

Check you have used the same backslash

Also if testing in Xcode I have found it gets upset if you don't have a space either side of the = sign.

Thanks so much for the feedback. I finally did it. It required ("Learning (language)"). Just glad I can move on. I now have interpolation down now. Lol

It should not have passed if you didn't include the backslash. That's the only way the compiler will know that you need to interpolate a string.