Chapter    25

Control Transfer Statements

Control transfer statements change the order that your code is executed in. You use these when you have specific situations where you would like to change the normal execution of code based on a condition that you specify. You have four control transfer statements available to you: continue, break, fallthrough, and return.

Note  Only the first three control statements are discussed in this chapter because the return control statement is discussed in Chapter 27.

continue Statement

Use the continue statement with loops to stop code execution and return to the beginning of the loop’s code block. For example, let’s say you wanted to print out the numbers 1 through 3 and 8 through 10 to the console log screen. ...

Get Swift Quick Syntax Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.