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) Control Flow While and Do-While Loop

I'm trying to use the "do while" loop like shown in the video. But I'm getting an error message: do is not allowed.

I'm prompt to use the "repeat" instead. Is this because of my version of Xcode? Also the "println" function is also not allowed.

3 Answers

Hi Bruno!

Some of the issues you are experiencing may be due to changes made to the Swift programming language. I know one of the changes that effects a lot of the users here at Treehouse was changing 'println' to just 'print'. Don't worry though, often times a quick Google can help you solve the problem or Xcode might even give you a tip on what to do.

If you don't really want to have to worry about Googling things and changing your code around then I would recommend that you start the Swift 2 Track.

I hope that I helped you out and happy coding!

-Luke

Hey Luke thanks a lot. You've been very helpful

Cheers,

Bruno

Josh Bennett
Josh Bennett
15,258 Points

do-while is now repeat-while

Josh Bennett
Josh Bennett
15,258 Points

do-while is now repeat-while