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 2.0 Basics An Introduction to Swift Programming Working With Variables

joaquin encinas
joaquin encinas
262 Points

Compiler not working

im trying to compile my code and is giving me an error but not showing what is wrong when I hit compile. I ran the same code in Xcode and it works

var str = "Language"

str = "Swift"

variables.swift
// Enter your code below

var str = "language"

str = "Swift"

1 Answer

Jason Anders
MOD
Jason Anders
Treehouse Moderator 145,860 Points

Hey Joaquin,

Challenges are very specific, so you have to pay close attention to what is being asked. This Task asks to "Declare a variable named language and assign the string "Swift".

You have declared a variable named 'str' and assigned it the string "language." For Task one, you only need one line of code to declare and assign the variable.

var language = "Swift"

This way the variable (var) is called 'language' and the string assigned is "Swift"

Keep Coding! :dizzy: