Swift Style, Second Edition (PragProg)

Apple’s Swift programming language has finally reached stability, and developers are demanding to know how to program the language properly.

Erica Sadun

edited by Brian MacDonald @bmacdonald

Apple’s Swift programming language has finally reached stability, and developers are demanding to know how to program the language properly. Swift Style guides you through the ins and outs of Swift programming best practices. Refreshed for Swift 4 and 5, this is the best practices book for serious, professional Swift programmers and for programmers who want to shine their skills to be hired in this demanding market.

A style guide offers a consistent experience of well-crafted code that lets you focus on the code’s underlying meaning, intent, and implementation. This book doesn’t offer canonical answers on Swift coding style. It explores the areas of Swift where structure comes into play. Whether you’re developing a personal style or a house style, there are always ways to enhance your code choices. You’ll find here the ideas and principles to establish or enhance your own best style practices.

Begin with simple syntactical styling. Perfect spacing and layout. Master literal initialization and typing. Strengthen code bracing for easy readability. Style your closures for safety and resilience. Optimize control flow layout and improve conditional style choices. Transition from Objective-C and move code into Swift the right way. Boost API design using proper naming and labeling. Elevate defaulted arguments and variadics to their right places. Finally, Erica offers her own broad recommendations on good coding practice.


“This is one of the most important resources on the language. A must-have on every Swift programmer’s desk.”

- Paris Buttfield-Addison, Founder, Secret Lab Pty. Ltd.


  • Full details: Search
  • View this book’s portal and details on how to post errata and suggestions here.

Don’t forget you can get 35% off with your Devtalk discount! Just use the coupon code “devtalk.com" at checkout :+1:

2 Likes