4.4 Summary
Congratulations, you’ve worked through one of the subjects of utmost importance! With knowledge of control flow statements, you can steer the code into any direction necessary.
As a wrap-up, we started with conditional statements like if and switch, which are used to execute alternative code snippets depending on given conditions.
That was followed by a section on loops, where we went through examples to explain the use of for-in, while, and repeat-while iterations to process collections.
Finally, you learned about control transfer statements like break, continue, fallthrough, and guard, which enable early exits from code blocks if necessary.
As you become more experienced in Swift, you can start to program more realistic examples ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access