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

Alan Hanson
Alan Hanson
332 Points

work on var

what is a string

string_assignment.swift
var greeing = "swift programmingLanguag" 

1 Answer

Chris Shaw
Chris Shaw
26,676 Points

Hi Alan,

Here is the question from the challenge...

Create a variable named greeting and assign it a value of "Hello".

What the challenge is asking for is the most basic variable called greeting that contains a string value of Hello, in Swift we can achieve this using the code below.

var greeting = "Hello"

Without knowing your exact skill level I recommend you go through the Introduction to Programming course, which, while it's an older course still demonstrates some very basic and common coding practices across all languages including Swift.

If you're still having trouble understanding Swift let us know as we're always here to help out.