Book Image

Beginning Swift

By : Rob Kerr, Kåre Morstøl
Book Image

Beginning Swift

By: Rob Kerr, Kåre Morstøl

Overview of this book

Take your first foray into programming for Apple devices with Swift.Swift is fundamentally different from Objective-C, as it is a protocol-oriented language. While you can still write normal object-oriented code in Swift, it requires a new way of thinking to take advantage of its powerful features and a solid understanding of the basics to become productive.
Table of Contents (10 chapters)

Chapter 2. Swift Operators and Control Flow

In the last lesson, you learned the fundamentals of Swift syntax, data types, and how to use variables to store and operate on data in a Swift program.

In this lesson, you'll learn how to use the fundamental flow control structures and language elements that form the building blocks for Swift programs.

Swift contains a full set of flow control constructions that help you build logic and organize applications. Swift implements control structures you'll find familiar, and Swift adds modern features and extensions not available in some other languages.

This lesson also covers the broad range of Swift logical and bitwise operators. Swift supports a comprehensive set of operators, based on the C operator construction—but with modern extensions that we'll fully cover in this lesson.