Mobile
Article
By Adam Roberts

Swift: Apple’s New Language for iOS

By Adam Roberts
Last chance to win! You'll get a... FREE 6-Month Subscription to SitePoint Premium Plus you'll go in the draw to WIN a new Macbook SitePoint 2017 Survey Yes, let's Do this It only takes 5 min

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.

--ADVERTISEMENT--


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.

Login or Create Account to Comment
Login Create Account
Recommended
Sponsors
Get the most important and interesting stories in tech. Straight to your inbox, daily.
Is it good?Is it good?