O'Reilly logo

Swift Translation Guide for Objective-C Users: Develop and Design by Maurice Kelly

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 4. Control Structures

Working with data is difficult if you have to do it in a completely linear manner, which makes control structures a vital part of any programming language. On the surface, the control structures in Swift are the same as those in Objective-C, but once you start to dig a little deeper you will begin to find that they go beyond what was possible before in a number of ways.

General Changes

Like Objective-C, Swift has four main control structures:

Image for and for-in loops

Image while and do-while loops

if conditional blocks

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