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.
forloops give you, use an underscore instead so Swift can skip that work.
whileloops, which you provide with an explicit condition to check.
repeatloops always run the body of their loop at least once.
break, but if you have nested loops you need to use
breakfollowed by whatever label you placed before your outer loop.
while true. Make sure you have a condition somewhere to end your infinite loops!
SPONSORED Catch bugs as soon as they happen and know exactly why a crash occurred. Instabug's SDK grabs all the logs they need to fix bugs, crashes and performance issues in minutes instead of days. Get screenshots, device details, network logs, repro steps, and tons of other critical insights needed to resolve issues and prioritize product backlogs straight from your dashboard. It only takes a minute to integrate!
Link copied to your pasteboard.