O'Reilly logo

Swift Quick Syntax Reference by Matthew Campbell

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required