O'Reilly logo

Professional Swift by Michael Dippery

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

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

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