DEV Community

Nathan Mattes
Nathan Mattes

Posted on • Originally published at zeitschlag.net on

100 Days of SwiftUI — Day 4

Day 4 was about loops. I learned how to exit outer loops when using nested loops — you can use so called labels and break label and that's it:

outerLoop: for i in 0..<10 {
  for j in 0..<10 {
    if i*j == 16 {
      // do something
      break outerLoop
    }
  }
}

And again: I should read the tasks of the test more carefully. Most of the time I don't see that the code wouldn't run at all as a constants should be changed, for example.

Top comments (0)

Heroku

This site is powered by Heroku

Heroku was created by developers, for developers. Get started today and find out why Heroku has been the platform of choice for brands like DEV for over a decade.

Sign Up

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay