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) Variables and Constants Constants

AJ Thomas
AJ Thomas
249 Points

i don't get how to write the constant

Iv'e tried to write it multiple times and I don't know how

constants.swift

1 Answer

Jared Watkins
Jared Watkins
10,756 Points

You declare a constant typing 'let' and then the name of the constant. The task asks you to name the constant language, so that is it's name. Then, you you say what the constant is, or what the constant is equal to, or what the constant is holding.. So, if you want your constant to be a string like "Swift", you set the constant equal to " Swift". the quotes mean it's a string, so that's why you use them.

It might look like this:

let language = "Swift"