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 Variables

Tim Nicholson
Tim Nicholson
1,131 Points

Quiz completion I am new tea treehouse and am trying to complete a course. I don't know what to do on the first quiz.

I am new to team treehouse and don't know how to complete a quiz. I typed my code in the box and selected check work. It gives a comma error. I am using an iPad.

string_assignment.swift
 var str greeting = "Hello"

1 Answer

Jhoan Arango
Jhoan Arango
14,575 Points

Hello Tim:

When declaring a variable or a constant you have to give it a name, a type and a value. The type it's not necessary as swift infers it depending on the value that you give it.

var greeting = "Hello"