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 trialUnsubscribed User
100 PointsVariables 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
// Enter your code below
let name: String = "Linda"
var greeting: String = "Hi there, \(name)."
1 Answer
Ryan Huber
13,021 PointsYou 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)."
Unsubscribed User
100 PointsUnsubscribed User
100 PointsHi Ryan,
thanks for your help. It#s getting late today :D
Unsubscribed User
100 PointsUnsubscribed User
100 PointsHi,
this doesn't work, too. I think the challenge is dumb. I've skipped it.
Ryan Huber
13,021 PointsRyan Huber
13,021 PointsI just tried it and it make you take out the
: String
part. I don't know why but that worked for me.