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 Take the pain out of configuring and testing your paywalls. RevenueCat's Paywalls allow you to remotely configure your entire paywall view without any code changes or app updates.
Sponsor Hacking with Swift and reach the world's largest Swift community!
Link copied to your pasteboard.