WWDC 2014: 10 things you need to know about Swift

Here are 10 things you need to know about Apple's new Swift programming language.
Written by Adrian Kingsley-Hughes, Senior Contributing Editor

Apple chose the WWDC 2014 keynote to unveiled to developers a new programming language called Swift. Here are 10 things you need to know about this new programming language.

(Source: Apple)
  1. Swift is Objective-C without the C: This new language is being billed by Apple as a "fast, modern, safe, interactive" programming language. This idea behind it – based on what we've seen from the WWDC 2014 keynote – seems to be to make building apps easier than ever.
  2. Works in iOS and OS X: Swift isn't just for creating apps for iOS devices, but developers can also leverage it to create apps for OS X.
  3. Swift is fast: According to Apple's figure, Swift blows Python and Objective-C out of the water when it comes to tasks such as complex object sort and RC4 encryption. This, according to Apple, allows developers to spend more time creating apps and less time optimizing code.
  4. Modern: Swift includes modern features such as multiple return types, closures, generics, type interfaces, namespaces, and much more. Bottom line here is that developers won't be giving anything up by choosing Swift over Objective-C.
  5. Fits right in: Swift isn't going to upset developer workflow because it can fit right alongside Objective-C and C, so developers can use it as and when they feel is appropriate, allowing them to create mixed-language apps.
  6. New language, same infrastructure: The new Swift language fits right into Apple's existing Cocoa and Cocoa Touch framework, it is built using the same LLVM compiler, it uses the same optimizer and autovectoring and the same ARC memory manager, and the same runtime as Objective-C.
  7. Easy debugging: The debugging console in Xcode contains an interactive version of the Swift language built right into it called Interactive Playground. This means developers can use Swift syntax to evaluate and interact with a running app, write new code to see how it works in a script-like environment, or even use it to develop new algorithms. This is available from within the Xcode console, or in Terminal.
  8. Eliminating unsafe code: Apple has designed Swift to do away with entire classes of unsafe code. Variables are always initialized before use, arrays and integers are checked for overflow, and memory is managed automatically.
  9. Migration: Apple is making it possible – and easy – for developers to migrate apps from using Objective-C to Swift to improve architecture, logic, and performance.
  10. Play with it today: You can download the Xcode 6 beta and peruse the language guide today.
Editorial standards