Swift: C-style for statement has been removed in Swift 3

Swift error: C-style for statement has been removed in Swift 3:


let t1=60


solution:

let t1=60

for i in stride(from:0, through:t1,by: 5)
{
    print("\(i)")
}

output:
0
5
10
15
20
25
30
35
40
45
50
55
60

or

let t1=60

for i in stride(from:0, to:t1, by: 5)
{
    print("\(i)")
}

output: 
0
5
10
15
20
25
30
35
40
45
50
55

留言