Apple surprised all the developers at its WWDC event by introducing a new programming language, SWIFT for writing iOS & OS X Apps. It is expected that this programming language can replace Objective-C as the main programming language on Apple’s platforms.
The same LLVM compiler and runtime is used by Swift as Apple’s Objective-C implementation and thus, both the languages can live alongside in the same application. This latest language provides access to all of the Cocoa and Cocoa Touch features that currently developers are using to from Objective-C. Software engineering VP Craig Federighi called the language “fast, modern, and designed for safety” while speaking at Apple’s annual developer conference. It’s like “Objective-C, without the C,” he added.
“When it comes to speed, Swift is great. Swift is also modern with features like closures, multiple return types, and namespaces. Swift is completely native to both Cocoa and Cocoa Touch,” according to Federighi. The Beta version of this language is available for Apple’s developer program members.
“Xcode Playgrounds make writing Swift code incredibly interactive by instantly displaying the output of Swift code,” according to Apple.
Glance At Swift’s “Playground” development environment
Comparing Objective-C and Python with Swift, it is far better at handling RC4 encryption, claimed by Federighi.
Some More Spice on Swift’s speed:
According to press release, Apple calls Swift “a powerful new programming language for iOS and OS X that makes it easier than ever for developers to create incredible apps.” Apple claims that “Swift helps developers write safer and more reliable code by eliminating entire categories of common programming errors, and coexists with Objective-C code, so developers can easily integrate Swift into their existing apps.”
“Swift is going to be ready for primetime out of the gate,” and will feature “complete Xcode support,” according to Federighi. He also added, developers “can submit Swift apps to the App Store” once iOS and OS X are made available.
Highlights Of The SWIFT Language According To Apple:
- Tuples and multiple return values
- Fast and concise iteration over a range or collection
- Structure that support methods, extensions, protocols.
- Functional programming patterns, e.g.: map and filter
- Closures (similar to blocks in C and Objective-C) unified with function pointers