Swift语法基础:17 - Swift的For循环, While, Do-While, If, Switch
在Swift中, 也有控制流, 分别是For, For-In, For条件递增, While, Do-While等等, 让我们一起来探讨一下: 1.For循环 在Swift中提供两种循环, 一种是For-In, 另一种是For条件递增, 先来看第一种: for index in 1...5 {
println("\(index) times 5 is \(index * 5)")
}
//