In a major surprise, Apple has announced that they will be open-sourcing Swift later this year, when it graduates to 2.0, during the keynote presentation at Apple's annual World Wide Developer’s Conference.
“We’re stepping on the gas this year with Swift 2,” Apple’s Craig Federighi announced at the WWDC Keynote adding “We think Swift is the next big programming language …We think Swift should be everywhere and used by everyone.”
Despite Swift 2.0 being announced with a whole list of features and improvements, open-sourcing the language will springboard feature development by outsourcing contribution and improvements beyond Apple’s walls, resulting in more rapid improvements to the language.
More profoundly, Craig Federighi’s comments indicate Apple’s willingness to cease control of the language, and allow for it to be developed and used through compilers, on other platforms, including Linux and Windows, beyond native mobile development, into other platforms. Apple has already stated the will be releasing developer tools for Linux, and possibly Windows in the near future.
Other improvements for Swift announced include improvements to the compilation time, improved fix-it suggestions, introduction of Markdown into comments, as well as a new header-like Swift assistant API view within Xcode 7. Speaking of Xcode 7, we will also see a new availability check that will inform the developer if the code won’t work on a specific target OS.
The compiler will give you an error when using an API too new for your minimum target OS, and a new keyword lets you wrap blocks of code in a conditional version check to run only on specific OS releases. (Source: Apple)
Error Handling has also been improved, with a new advanced error-handling model for not only catching and throwing errors, but easily creating custom error types. Various other syntax improvements were introduced, including new control-flow keywords such as guard and defer and protocol extensions.
Swift 2.0 is slated to be released in Fall 2015, along with iOS 9, although Apple’s registered developers will have early-access to iOS 9 and Swift 2.0 from today. For a complete list of what’s changed in Swift 2, refer to the official Document Revision History.
Image Source: TechCrunch.com