You’ve made it to the end of the fourth part of this series, so let’s summarize:
for
, which assigns each item inside the loop to a temporary constant.for
loops give you, use an underscore instead so Swift can skip that work.while
loops, which you provide with an explicit condition to check.while
loops, repeat
loops always run the body of their loop at least once.break
, but if you have nested loops you need to use break
followed by whatever label you placed before your outer loop.continue
.while true
. Make sure you have a condition somewhere to end your infinite loops!SPONSORED Get accurate app localizations in minutes using AI. Choose your languages & receive translations for 40+ markets!
Sponsor Hacking with Swift and reach the world's largest Swift community!
Link copied to your pasteboard.