Apple today announced a slew of products, including a new SDK and the Swift programming language to complement the impending releases of iOS 8 and OS X “Yosemite” in the fall, all at the company’s Worldwide Developer Conference.
The Swift programming language is “Objective-C without the baggage of C,” according to Apple SVP of software engineering Craig Federighi. Swift features include closures, generics, type inferences, multiple return types, and name faces, and Swift code fits alongside Objective-C and C code in the same application built using Apple’s Xcode development tool.
Swift uses the same runtime as Objective-C and is compatible with the Cocoa and Cocoa Touch frameworks, allowing developers to build with the LLVM compiler using ARC memory management. The language also comes with an environment called Playground, which allows developers to code while simultaneously watching the changes made to their app in real time. Playground also provides a functional map algorithm to apply closure to every element.
Swift comes with complete Xcode support, code completion and debugging. A Swift language guide and reference documentation are available in iBooks, and when iOS 8 and OS X “Yosemite” are released to the public in the fall, developers can submit apps coded in Swift to the App Store immediately.
Apple CEO Tim Cook and Federighi also debuted a new SDK, which Cook called the biggest developer release since the launch of the App Store. The SDK offers 4,000 new APIs as well as extensibility, which will allow apps to extend their system and offer services to other apps, increasing interoperability with app extensions.
The extensibility also extends to third-party apps defining widgets that appear in the notification center, and a new system-wide third-party keyboard extension. Developers can also now create app bundles and app previews for users, and a new service called TestFlight allows developers to invite users to free private beta testing of their apps.
Some of the other APIs announced include a Touch ID API to integrate fingerprint security into third-party apps, and a HomeKit API to unify Internet of Things devices in the home with a common network protocol. For game developers, Apple debuted Metal, an API that reduces the overhead layer of OpenGL 3D video to increase the performance of games running on iOS 8, along with the existing SpriteKit and new SceneKit APIs to code both complex and casual games.
Finally, Cook announced CloudKit, a free client-side programming model to scale the data and logic of apps on the server-side using Apple’s iCloud.
Chris Lattner demonstrates a swift-coded app in Playground