Preface

 

It seems everyone has a brilliant idea brewing for an iOS app these days, though not many actually do the work to see it to fruition. Even putting potential revenues aside, the prospect of making your own app and seeing people download and appreciate your work is exciting. This book should send you on the way to building your first app using Swift.

What is Swift?

Swift is the modern language created by Apple for iOS that got the Apple developer world buzzing back in June 2014—but why was Swift created in the first place?

While loved by many iOS developers, Objective-C was seen by some as an outmoded language. More than 30 years old and based on C, it had a verbose and peculiar syntax, with an unsafe type system. Built as a modern alternative to Objective-C, Swift was designed with specific enhancements in mind, specifically:

  • Safety—Swift introduced several programming concepts to reduce some common programmer mistakes. These include strong typing, optionals, and error handling.
  • Performance—Apple introduced internal optimizations to ensure that Swift runs fast. Xcode also provides warnings to encourage you to write code that ensures your app is running optimally.
  • Expressiveness—Expressive code maintains the right balance between clarity of meaning and succinctness. Swift draws on lessons learned from Objective-C and other languages to introduce several concepts that may be new at first, but in time you’ll wonder what you did without them!

Why learn Swift?