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 Collections and Control Flow Introduction to Collections Working with Arrays

Swift Arrays

Challenge Task 1 of 4

We just learned the ins and outs of arrays, so let's put that knowledge into practice. Start by declaring a new array of Ints with six numbers as values. Assign this array to a variable named arrayOfInts.

arrays.swift
// Enter your code below

var arrayOfInts todo: [string] = [
    "1",
    "2",
    "3"
    "4"
    "5"
    "6"]

5 Answers

Hello Ary. Try Brendan's suggestion and let us know if you need any further insight!

this quiet hard i am try but i can't do...

It always helps me to go back over the videos to rewatch something that I may still be having problems with. Maybe you should go back over the videos that deal with creating arrays? Try that!

I tried but did not work, I do not have much experience with ios

Brendan Whiting
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Brendan Whiting
Front End Web Development Techdegree Graduate 84,738 Points

Sorry I forgot something. They want it to be an array of Ints not Strings. So the code would look like this:

var arrayOfInts: [Int] = [
    1,
    2,
    3,
    4,
    5,
    6]

thanks