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, protocols, 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 writing about Swift is that the language is still evolving. When they introduced it, Apple stated that the language specification was not final, and that the syntax and feature set would change. Since the initial release, there have been two significant updates (versions 1.2 and 2.0), both of which introduced new features, and in some cases changed existing features. Fortunately, Xcode can detect most of the cases where your code is using an older syntax or feature, and offers hints at what to change to address this.

Despite the uncertainty of a changing language, Swift continues to show great promise. It follows on from the company’s other major developer tools initiatives (all led by Lattner) including LLVM, Clang, LLDB, ARC, ...

Get Swift Pocket Reference, 2nd Edition now with the O’Reilly learning platform.

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