Swift 3.0 is the latest iteration of Apple's programming language. The new features for Swift were unveiled during Apple's WWDC 2016 (Worldwide Developers' Conference) on 13 June 2016.
Following Apple's WWDC announcement, Swift 3.0 was made available to developers. The Swift 3.0 Preview 1 is available as part of Apple's Xcode 8.0 beta. The good news is that anybody can get hold of Xcode 8.0 Beta, and it's not locked to developers with a paid Apple Developer Program account (unlike the early betas of iOS or OS X).
In this article, our complete guide to Swift and Swift 3.0 in particular, we look at all the new features and explain everything you need to know about Apple's Swift programming language.
Complete guide to Swift 3.0: New features
The Swift Programming Language (Swift 3 beta) book outlines most of the new features implemented in Swift. Near the end of the book is the Document Revision History, which serves as a great guide to the new features implemented in Swift 3.0.
Here are some new features implemented in Swift 3.0 documented in the revision history:
- All function parameters have labels by default.
- Attribute arguments use a colon.
- Swiftch cases with multiple patterns have new functionality.
- Line control statements use the #sourceLocation(file:line) syntax.
Nonescaping Closures and Autoclosures are now type attributes rather than declaration attributes.
Parentheses are now required around the parameter types in functions.
You can discover more about the new features in Swift 3.0 by reading The Swift Programming Language (Swift 3 beta) or by heading over to Swift.org's Migration Guide.
Porting to Windows and Linux
One major implementation that we're going to see with Swift 3.0 is the porting of Swift to other operating systems. According to Apple's Swift Evolution GitHub page, the Swift team intends to "make Swift available on other platforms and ensure that one can write portable Swift code that works properly on all of those platforms."
That Swift is heading to Linux, and perhaps even Windows, is no secret. As soon as Apple made Swift open-source the potential was there to port it to other operating systems.
Craig Federighi, Apple's Senior Vice President of Software Engineering, said: "We're certainly open to the community creating a Windows port, and there's a good foundation for that in that the LLVM and Clang environments that are foundations for building and compiling Swift have been ported to Windows. We fully support the community doing that port. Regarding us getting the [open-source] project off the ground, we wanted to focus our energy on our platforms and Linux to start."
Sign up for CIO Asia eNewsletters.