O'Reilly logo

Swift for Beginners: Develop and Design, Second Edition by Boisy G. Pitre

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 3. Taking Control

In the last chapter, you spent some time getting to know Swift’s collections: arrays and dictionaries. Then you started looking at ways to iterate through those collections. In this chapter, you’ll continue looking at iteration and then move on to Swift’s ability to take directions on what to do at specific intervals.

If you haven’t already done so, start up the REPL in the Terminal application (remember, you can type xcrun swift to get it going). The line numbers in the figures in this chapter assume that you are starting with a fresh REPL session.

For What It’s Worth

As you saw in the previous chapter, Swift’s ability to iterate through a collection, be it an array or a dictionary, uses the for-in loop. Other variations ...

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