Swift Pocket Reference


Swift is an exciting new language from Apple, first announced at the Apple Worldwide Developers Conference (WWDC) in June 2014. The language started life as the brainchild of Chris Lattner, director of Apple’s Developer Tools Department, and is the next step in the evolution of Apple’s software development ecosystem.

Swift brings with it many modern language features, including type safety, generics, type inference, closures, tuples, automatic memory management, and support for Unicode (for character and string values as well as for identifiers). You can use a mixture of Swift and Objective-C in a single project, and either language can call APIs implemented in the other.

The challenge for anyone learning (or even writing about) Swift is that the language is still evolving. Apple has stated that the language specification is not final, and the syntax and feature set will change.

Despite the uncertainty of a changing language, Swift shows great promise. It follows on from the company’s other major developer tools initiatives (all led by Lattner) including LLVM, Clang, LLDB, ARC, and a series of extensions to Objective-C, and it’s clear that Apple sees it as the future language of choice for iOS and OS X software development.

Conventions Used in This Book

The following typographical conventions are used in this book:


Indicates new terms, URLs, email addresses, filenames, and file extensions.

Constant width

Used for program listings, ...

Get Swift Pocket Reference now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.