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

Variables with other Variables

Hi,

I using the Swift 2.0 Basics tutorial series to start learning Swift and maybe create apps in the near future. At the moment, I am at a quiz and my code doesn't work

On the bottom, you see a few lines of code which should work with Swift. The Workspace editor here on the site says that it's piece of shit, but in my Xcode it works great (see here: http://imgur.com/1vGroFi).

Is there anything I am doing wrong?! I don't get it :/

Jakob

strings.swift
// Enter your code below

let name: String = "Linda"
var greeting: String = "Hi there, \(name)."

1 Answer

You are very close and what you have will compile and run. You are declaring greeting as a variable instead of a constant which is what the task is asking for.

let name: String = "Linda"
// change var to let here
let greeting: String = "Hi there, \(name)."

Hi Ryan,

thanks for your help. It#s getting late today :D

Hi,

this doesn't work, too. I think the challenge is dumb. I've skipped it.

I just tried it and it make you take out the : String part. I don't know why but that worked for me.