‣ stride(from:to:by:)
stride(from:to:by:) counts from the start point up to by excluding the to parameter. So, the above for-loop can be written in swift using stride as:
for i in stride(from: 0, to: 10, by: 1) {
print(i) // prints from 0 to 9
}
‣ stride(from:through:by:)
stride(from:through:by:) counts from the start point up to by including the through parameter.
for i in stride(from: 0, through: 10, by: 1) {
print(i) // prints 0 to 10
}