📜  快速向后循环代码示例

📅  最后修改于: 2022-03-11 15:00:58.478000             🧑  作者: Mango

代码示例1
for index in stride(from: 10, to: 5, by: -1) {
    print(index)
}
//10, 9, 8, 7, 6, 5

for index in stride(from: 10, through: 5, by: -1) {
    print(index)
}

//10, 9, 8, 7, 6, 5