Part I. Language

This part of the book teaches the Swift language, from the ground up. The description is rigorous and orderly. Here you’ll become sufficiently conversant with Swift to be comfortable with it, so that you can proceed to the practical business of actual programming.

  • Chapter 1 surveys the structure of a Swift program, both physically and conceptually. You’ll learn how Swift code files are organized, and you’ll be introduced to the most important underlying concepts of the object-oriented Swift language: variables and functions, scopes and namespaces, object types and their instances.
  • Chapter 2 explores Swift functions. We start with the basics of how functions are declared and called; then we discuss parameters — external parameter names, default parameters, and variadic parameters. Then we dive deep into the power of Swift functions, with an explanation of functions inside functions, functions as first-class values, anonymous functions, functions as closures, and curried functions.
  • Chapter 3 starts with Swift variables — their scope and lifetime, and how they are declared and initialized, along with important Swift features such as computed variables and setter observers. Then some important built-in Swift types are introduced, including Booleans, numbers, strings, ranges, tuples, and Optionals.
  • Chapter 4 is all about Swift object types — classes, structs, and enums. It explains how these three object types work, and how you declare, instantiate, and use them. ...

Get iOS 8 Programming Fundamentals with Swift 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.