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 trialJohn Moron
1,658 Pointshow do you do you create a contect language and assign it string "swift"
How having trouble completing the content language challenge for ios i tried everything but cant figure out how to do it i tryed the way the video told me how but still cant figure it out
let randomConstant = "Random Text"
John Moron
1,658 PointsThat's what i put.
3 Answers
Alvin Abia
Courses Plus Student 23,034 PointsSo you can either declare an object as a constant or a variable. If I wanted to declare a variable named randomVariable and assign it the string "Random Text" I would do so like this:
var randomVariable = "Random Text"
var denotes that randomString will be a variable whose value can be reassigned. let on the other hand denotes that something will be a constant whose value can only be assigned once, like this:
let randomConstant = "Random Text"
John Moron
1,658 Pointsohh omg that's what i was supposed for do for let thanks for your help man.
John Moron
1,658 PointsI tried this but i wont work
Alvin Abia
Courses Plus Student 23,034 PointsAlvin Abia
Courses Plus Student 23,034 PointsCan you post the line of code you tried submitting in the challenge here? I'll see where your error's occurring.