Using swift loops?

Example:


  for number in 1...5 {
      print(number)
  }
  

Solution:

Swift provides several ways to loop over sequences. The example above uses a for-in loop to iterate over a range.

Beginner's Guide to Swift