Getting Started with Swift


Image c/o AppleInsider.com

Image c/o AppleInsider.com

At the most recent Apple Worldwide Developers Conference, Apple introduced Swift, a programming language for Cocoa and Cocoa Touch. Developers and designers alike were all abuzz about the new language that promised to simplify coding and more rapidly develop iOS and OS X applications.

If you have any experience with other OOPs like Objective-C, Python, or C#, then you’ve already got a head start on Swift, as it was heavily influenced by these languages, as well as many others.

In 2010, Chris Lattner, the Director of Developer Tools at Apple, began working on Swift.

“I implemented much of the basic language structure, with only a few people knowing of its existence,” wrote Lattner on his personal site. “A few other (amazing) people started contributing in earnest late in 2011, and it became a major focus for the Apple Developer Tools group in July 2013.

The Swift language is the product of tireless effort from a team of language experts, documentation gurus, compiler optimization ninjas, and an incredibly important internal dogfooding group who provided feedback to help refine and battle-test ideas. Of course, it also greatly benefited from the experiences hard-won by many other languages in the field, drawing ideas from Objective-C, Rust, Haskell, Ruby, Python, C#, CLU, and far too many others to list.”

Swift is still currently in beta but is available to developers now.

If you would like to get started with Swift, here’s what you need:

  1. Download Xcode 6 for your Mac
  2. Check out Apple’s Swift introduction and documentation
  3. Download The Swift Programming Language for iBooks
  4. Take advantage of the resources at LearnSwift.tips
  5. ???
  6. Profit

To start a new application, open Xcode, choose File > New > Project > Application. Then, switch the language in the drop down to Swift.

If you plan on submitting an application to the App Store, you will need to join the iOS Developer Program.

Be careful, as Apple does not promise that the beta version of Swift will be completely compatible with the stable release. That’s no reason not to play around with the language, and try to make a ton of money off of the next Angry Birds or Flappy Bird.

Speaking of Flappy Bird, Nate Murray, the game’s creator, developed a clone of the game in Swift. It’s called FlappySwift. You can download the source code for FlappySwift here.