5. Loops

If you know any programming language, you probably have heard the word loop most frequently. Yes, Swift, too, has loops. Basically, the structure of a loop is simple, run a block of code repeatedly while a condition is true or until the condition is false.

There are three kinds of loops in Swift:

  • For loops

  • While loops

  • Repeat-while loops

Last updated

Was this helpful?