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 trialJorge Ayala
1,025 PointsCould anyone guide me on the right direction on this problem?
I got the first part, but I need help with println.
var todo: [String] = ["Learn Swift" , "Build App" , "Deploy App"]
3 Answers
jcorum
71,830 PointsJorge, you use the count property to get the length of an array:
var todo: [String] = ["Learn Swift" , "Build App" , "Deploy App"]
println(todo.count)
justinm
10,385 PointsJorge, 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
1,025 PointsGreat, 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
10,385 PointsTreehouse 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!
Jorge Ayala
1,025 PointsJorge Ayala
1,025 PointsOh ok, I was making the mistake of writing println.count. Thanks for the help.