BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News Apple Releases Swift 2.2 for OSX and Linux

Apple Releases Swift 2.2 for OSX and Linux

Leia em Português

This item in japanese

Bookmarks

Apple has released Swift 2.2, the latest version of their mobile and server programming language. This version is the first official release that has been contributed to by open-source developers, including contributions from 212 non-Apple contributors. Some of these are typos, contributed in the first few days of Apple's open-source Swift release, leading Chris Lattner to proclaim:

The release also includes a number of enhancements that have followed Swift's evolution process, including some proposed by non-Apple contributors:

The Swift project has expanded to allow others to commit directly to the repository, for those that have published good work in the past.

Swift 2.2 is included with Apple's release of Xcode 7.3, which has also been published. The official release means that iOS applications can now be submitted to the AppStore using Swift 2.2. For Linux builds, official binaries are available for Ubuntu 14.04 and 15.10. However, the Linux port is not yet complete; there are a number of missing components in the standard swift core libraries that are scheduled to appear in Swift 3 later this year. The IBM Swift sandbox is currently running a development build of Swift 3.0 but may add a Swift 2.2 option as well in the near future.

The ongoing development of the Swift Package Manager means that it is not yet part of the official builds; it too is scheduled to be released with Swift 3.0.

There is an updated version of the Swift Programming Language ePub document, as well as the HTML version available at Apple.

Changes in Swift 2.2

There are a number of changes in Swift 2.2 which will affect existing source code written for previous versions. These include:

  • Removal of the C-style for loops, along with the increment ++ and decrement -- operators.
  • Functions can no longer be defined as taking curried arguments directly, but instead return a function that takes an operator.
  • Objective-C selectors can be referenced using #selector(doSomething) instead of Selector("doSomething"), and is now compile-time checked.
  • Most keywords can now be used as argument labels
  • Associated types can now be related to a protocol, allowing them to have generics in classes that adopt the protocols.

The language book also includes a description of Automatic Reference Counting which may have not been clear before.

Swift 2.2 is available for immediate download via the Swift website.

Rate this Article

Adoption
Style

BT