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) Collections What is an Array?

arrays

create a string array and assign the following tasks to it .

Please quote the exact question and your code, plus maybe the class that it's for too. It helps! :)

2 Answers

Hi Shantanu,

The code you need is builde up out of two things, at first declaring a variable, and second adding things to it. Lets start with the declaration:

var todo =

than we will put the array with things to do in to the var:

var todo = ["Learn Swift","Build App","Deploy App"]

You now have got a variable called todo, containing an array with strings, the string is market with "" and the array with [] I hope you can go further with learning swift now!

Try var (name) = ["thing", "thing2", "thing3"]