Curious about what’s new in Swift 3? Check out Daniel Steinberg’s complete collection of SwiftCasts videos below, in which he gives us a quick look into many of the new proposals that were accepted into Swift 3, including code examples. The series covers everything from importing Objective-C Constants as Swift Types to clear nomenclature in API design.
You can also find the individual posts for this 3-part series in the following links. Each post includes a transcription of the videos, code examples, and links to all proposals mentioned throughout the series:
- Part 1 - Enums and Parameters
- Part 2 - Functions & Closures, Collections, and Living with Guidelines
- Part 3 - Clarity, Good Looking C, and API Guidelines.
Introduction
Part 1: Enums & Parameters
In the first part of this series, Daniel Steinberg starts with a simple topic, Enum and Parameters, that went through a lot of changes. This includes improvements, for example, in the way you import Objective-C constants as a Swift enum
or struct
type, helping get rid of a lot of prefix name duplication.
It also includes changes that help normalize the behaviour and use of certain keywords. For example, now there will be consistent label behavior for functions across all the parameters, including the first label.
Check out the full videos for more information:
Enums
Parameters
See the original Part 1 post here.
Part 2: Functions & Closures, Collections, and Living with Guidelines
The second part of the series also includes multiple proposals to help normalize the Swift source. The topics in the following videos include:
- Removing the currying function declaration syntax (that did not mean that currying was going away);
- Removing the increment (
++
) and decrement (--
) operators. This proposal forces the use of+=
instead of++
; - Multiple changes regarding
typealias
, including replacing thetypealias
keyword withassociatedtype
for associated type declarations.
Check out the full videos for more information:
Functions And Closures
Collections
Living with Guidelines
See the original Part 2 post here.
Part 3: Clarity, Good Looking C, and API Guidelines
Daniel Steinberg finishes the series with a set of more in-depth topics. A lot of the proposals for Swift 3 had the goal of making code easier for humans to parse, which included things like restructuring condition clauses.
Besides that, the API Design Guidelines is an especially important proposal that affects many of the others, and is definitely worth taking a look at. There are a lot of changes specific to naming functions and parameters, focusing on clarity instead of brevity.
Check out the full videos for more information:
Clarity
Good Looking C
API Guidelines
See the original Part 3 post here.
Receive news and updates from Realm straight to your inbox