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

I can't work out a solution to this? It says i need to define a constant? i thought i did this?

"let language: String = "Swift"

5 Answers

those to " aren't in the code they are just to show that what i typed

Alexander Batalov
Alexander Batalov
21,887 Points

than you need one extra at the end

let language = "Swift"

or

let language : String  = "Swift"
Stone Preston
Stone Preston
42,016 Points

the challenge wants you to let the type be inferred. if you use an explicit type it wont pass which is a bit of a bug. your code is correct, but remove the type specifier for the sake of the challenge:

let language = "Swift"

some of the swift challenges Ive done have been very picky about what they do and do no accept

Thankyou Guys. I've done it now. Thanks for the help ✌️

Amit Bijlani
STAFF
Amit Bijlani
Treehouse Guest Teacher

Thanks James. I've modified the challenge to account for what you typed.