CONTENTS

INTRODUCTION

PART I: BUILDING APPLICATIONS WITH SWIFT

CHAPTER 1: A SWIFT PRIMER

What Is Swift?

Why Learn Swift?

Working with Constants and Variables

Understanding Swift Data Types

Using Numerical Types

Boolean Types

Using Character Types

Using Arrays

Using Dictionaries

Using Tuples

Working with Type Annotations

Minimizing Annotation with Type Inference

Clarifying Code with Type Aliasing

Working with Operators

Using Basic Operators

Using Compound Assignment Operators

Using Overflow Operators

Using Range Operators

Using Logical Operators

Using Comparison Operators

Using Custom Operators

Making Decisions with Control Flow

Using Conditional Statements

Using Loops

Control Transfer Statements

Grouping Types with Enumerations

Working with Functions

Declaring Functions

Specifying Parameter Names

Defining Default Parameters

Specifying Variadic Parameters

Specifying Constant, Variable, and In-Out Parameters

Function Types

Using Closures

Summary

CHAPTER 2: WRITING A SWIFT PROGRAM

Setting Up Xcode

Downloading from Apple's Developer Portal

Downloading Xcode

Experimenting with Playgrounds

Using Playgrounds in Xcode

A Simple Example in Playground

A More Exciting Playground Example

Writing Swift in Xcode

Creating a New Swift Project

Creating the Swiftisms App

Creating the Interface

Creating Connections between the View Controller and the Object

Connecting the Buttons and the Action

Displaying Random Strings

What Next?

Debugging Swift Applications

Understanding Breakpoint Types

Setting ...

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