Chapter 3. What’s Changed in Swift 3?
In this chapter, we’ll explore the new standard library features, syntax changes, and other new parts of the Swift 3 release, and explain how they differ from the old stuff.
In the previous chapter, we explained how the Swift evolution process works. When a proposal gets accepted for a Swift release, in this case Swift 3, there are two states it could be in:
-
Accepted and implemented, or mostly implemented
-
Accepted but not implemented yet
Proposals in the second state have the potential to be held for a subsequent Swift release if they’re not implemented in time.
The full list of accepted proposals, in both states, is available at the Swift evolution project. There are too many to list here, so you should take a look at the website to get an idea of the magnitude of the changes. Go ahead; we’ll wait.
Using the New Stuff
In this report, we’ve selected some of the most important, impactful, or otherwise interesting changes that are being made to the language in version 3. Here’s the list:
-
The API guidelines are applied to the Swift standard library.
-
The
++
and--
operators have been removed. -
C-style
for
-loops have been removed. -
libdispatch
now has a nicer, Swiftier API. -
First parameters in functions now have labels.
-
Foundation types are now imported as Swift types.
-
Objective-C lightweight generic types are imported as Swift generic types.
-
Function parameters may no longer be variables, and are now always constants.
Get What's New in Swift 3 now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.