Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

iOS Swift 2.0 Basics An Introduction to Swift Programming Constants

I can't pass the challenge after this video. how can I see the solution in order to understand my error?

That is what I have done. let FavDesserts = "FavDesserts" str = "Chocolate Cake"

2 Answers

David Papandrew
David Papandrew
8,386 Points

Here's the solution:

let favDessert = "Chocolate Cake"

Note the challenge asks for the constant to be singular, e.g. "favDessert" not "favDesserts". The challenge also probably wants camel case, so lowercase for the start of the constant name (this is standard Swift practice anyway, so might as well get in the habit).

I think you should rewatch the video and see how he assigns a value to a variable. What you've done there is that you created two constants, FavDesserts and str, and you gave them respectively the value "FavDesserts" and "Chocolate Cake".

But you only need to create one called FavDesserts and assign it the name of your favorite dessert, which is probably Chocolate Cake