Check out example codes for "swift loop site:stackoverflow.com". It will help you in understanding the concepts better.

Code Example 1

let (first, last, interval) = (0, 100, 1)
var n = 0
for _ in stride(from: first, to: last, by: interval) {
    n += 1
}

Learn ReactJs, React Native from akashmittal.com