Skip to main content

Swift: Apple's New Language for iOS

By Adam Roberts



Free JavaScript Book!

Write powerful, clean and maintainable JavaScript.

RRP $11.95

At about 10am (PST) today we had a bit of an unusual traffic spike here at SitePoint HQ. A 2002 article about Swift 3D v3 quickly became our most popular article, and as I write this about six hours later it remains in the second-most clicked article today.

Those of you who have kept up with the announcements coming out of Apple’s Worldwide Developers Conference will have probably worked out why: one of the biggest things Apple announced this morning was a new programming language, Swift.

After 20 years of favoring Objective-C, Apple is now striking out on its own with a language apparently years in the making. The new language emphasizes speed (hence the name), safety and an interactive approach to development. But devs nervous about having to move wholesale into a new language can be reassured that Swift code can work alongside the old Objective-C in the same app.

A brief list of features, from Apple’s introduction to the language:

  • Swift pairs increased type safety with type inference, restricts direct access to pointers, and automatically manages memory—making it easy to create secure, stable software.
  • Swift includes optionals, generics, tuples, and other modern language features. Inspired by and improving upon Objective-C, Swift code feels natural to read and write.
  • Take advantage of powerful pattern matching in Swift to write simple, expressive code. Format strings naturally with string interpolation. Use frameworks like Foundation and UIKit directly from Swift.
  • Use playgrounds to experiment with new technologies, analyze problems, and prototype user interfaces.
  • The Swift compiler applies advanced code analysis to tune your code for performance, letting you focus on writing great apps instead of on implementing complex optimizations.

You can pick up an iBook introducing Swift from the iBookstore. If you’d prefer to get stuck into the language, you can get started by downloading the Xcode 6 beta.

What do you think of Swift? Let us know in the comments below.

Adam is SitePoint's head of newsletters, who mainly writes Versioning, a daily newsletter covering everything new and interesting in the world of web development. He has a beard and will talk to you about beer and Star Wars, if you let him.

New books out now!

Get practical advice to start your career in programming!

Master complex transitions, transformations and animations in CSS!

Latest Remote Jobs