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?

Jorge Ayala
Jorge Ayala
1,022 Points

Could anyone guide me on the right direction on this problem?

I got the first part, but I need help with println.

arrays.swift
var todo: [String] = ["Learn Swift" , "Build App" , "Deploy App"]

3 Answers

Jorge, you use the count property to get the length of an array:

var todo: [String] = ["Learn Swift" , "Build App" , "Deploy App"]
println(todo.count)
Jorge Ayala
Jorge Ayala
1,022 Points

Oh ok, I was making the mistake of writing println.count. Thanks for the help.

justinm
justinm
10,385 Points

Jorge, upon checking your question I noticed you are going through the swift course. I recommend switching over to the swift 2 track. It is the same material but the syntax is updated to reflect the changes as swift is new and occasional changes are made by Apple. For example, "printIn" is no longer used, it is now only "print".

Jorge Ayala
Jorge Ayala
1,022 Points

Great, that sounds better. Thank you I actually thought Swift 2 was a continuation from where Swift Basics ended, I didn't realize it was the same, but updated material. Also, I'm trying to become an iOS developer by learning Swift rather than learning Objective C, what other Swift courses do you recommend after I'm done with Swift 2?

justinm
justinm
10,385 Points

Treehouse is a great starting point for learning the swift language. Something different than learning iOS development. When you complete Treehouse Swift 2 course and feel comfertable with the language, you can check out rayWenderlich for more iOS development tutorials which will guide you through xcode more thoroughly. Also, Udemy has a bunch of development courses but most of them don't follow good coding practices. One that is popular and is the best I have seen in attempting to follow good practices is a course by Mark Price. iOS 9 from beginner to paid professional. It was only because I started with Treehouse that I even knew to look out for good practices and it helped me stay away to picking up bad habits.

Stick with Treehouse, put the time in to learn the actual swift language, and when you feel you exhausted the resources of Treehouse, move on to the other places I mentioned and you will already be ahead of the curve.

Good luck!