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!

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) Control Flow For-In Loop

Too Complicated... : (

Can someone explain this detail to me? I have no idea what's going on. It's too complicated. Thanks! : )

1 Answer

Emmanuel Ouzan
Emmanuel Ouzan
4,107 Points

Hi Oliver!

First, There is a lot of complicated stuff in our life :) But we have to learn how to overcome them on our own!

I know that in the beginning it's a bit hard to understand programming and especially loops, but you can do it !

I have a technic that helps me deal with hard learning stuff like this.

A)First, be sure that you understand all of Amit's video before the this video.

B) Try to separate the video to few parts. Try to understand every part alone and make sure that you understand the first part of the video before you continue.

C) Code it yourself! Open Xcode and duplicate Amit's code in your computer and see how this is going for you.

D) Don't loss hope ! It's not hard, it's just a bit challenging but I am sure you can do this ! :)

If you have more questions, feel free to ask me.

Have a great day!


Hi man, thanks for the support. BTW do you own a premium account? Is it worth getting? I wan't to be able to make iPhone games and publish them to the apps store. Will it work for me? Also... I focused really hard on it and copied this line of code that he wrote but Xcode said I made many errors and needed to put commas everywhere. Can you help? for number in 1...10{ println("(number) times 2 is \ (10 times) (number*2") }

Thanks- Oliver

Emmanuel Ouzan
Emmanuel Ouzan
4,107 Points

Hi Oliver,

First, I don't own a premium account yet, I am considering to upgrade, but I don't know yet.

You don't need a premium account to learn to make a game in Tree House. You have the course "Build a Game with Sprite Kit" available for the normal 25$/M pack. (In general I think that it will be very good to buy a premium account to support the amazing work that TreeHouse dose. This is one of the best places to learn programming!)

Before you consider to upgrade to premium you should learn the courses that the basic pack give's you! And then when you finish that you will ask yourself if you want to upgrade. For now Oliver, I see that you have only 284 points in Tree house, you should first complete the basic courses of IOS programming and then think about what you would like to do :)

I see that for the course "Build a Game with Sprite Kit" you will need to learn Objective - C. (Because Amit teaches how to use the Sprite Kit engine with Objective - C) So if all you want to know is how to build a game for iPhone and app creation is not really your thing, I recommend you to go to take the Objective - C course here because if not, you will get lost in the explanations of Amit in the Sprite kit course.

Answer to your loop question :

This is how it should be written:

for number in 1..<10 {
    println("\(number) times 2 is \(number*2)")

The commas are for the Println command.

println("Prints everything between those comma")

I hope I helped Oliver !

Good luck,