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

Kerry Emery
Kerry Emery
324 Points

i've gotten into an infinite loop and can't stop the code from executing to fix it. Is there an escape or halt command?

latest OS with macbook pro in Xcode. Do - while loop - didn't type the increment (index++) before it started executing - and now i'm unable to stop it.

4 Answers

Caleb Kleveter
MOD
Caleb Kleveter
Treehouse Moderator 37,862 Points

Try pushing the stop button witch is next to the play button.

which is where? I can't see a stop or play button and I'm locked in an infinite loop.

Caleb Kleveter
MOD
Caleb Kleveter
Treehouse Moderator 37,862 Points

When I think about it, I'm not sure that there is a stop button in play ground. Is that what you are using?

yes, no stop button in playground that I could find s I just shut down as I had no other option.