swift-如何在我的for循环中跳过一个迭代

时间:2019-04-29 11:34:54

标签: swift for-loop

我已经遍历这里提出的所有问题,但仍然没有找到可以在Swift中使用的解决方案。

如何实现这样的目标?

for n in 1...5
{
   if something {something happens}
   else {go to next iteration (skip the one you're in rn)}
}

我尝试将n设为变量,然后仅将n = n + 1放进去,但没有成功。预先感谢

0 个答案:

没有答案