What’s new in Swift 5.7?
This is an Xcode playground that demonstrates the new features introduced in Swift 5.7:
- if let shorthand for unwrapping optionals
- Multi-statement closure type inference
- Clock, Instant, and Duration
- Regular expressions
- Type inference from default expressions
- Concurrency in top-level code
- Opaque parameter declarations
- Structural opaque result types
- Unlock existentials for all protocols
- Lightweight same-type requirements for primary associated types
- Constrained existential types
- Distributed actor isolation
- buildPartialBlock for result builders
- Implicitly opened existentials
- Unavailable from async attribute
This is designed to complement my existing article What’s New in Swift 5.7. You might also want to read previous articles about the evolution of Swift 5:
- What’s New in Swift 5.6
- What’s New in Swift 5.5
- What’s New in Swift 5.4
- What’s New in Swift 5.3
- What’s New in Swift 5.2
- What’s New in Swift 5.1
- What’s New in Swift 5.0
Alternatively, you can find a complete breakdown of all Swift changes from 1.0 through 5.7, including downloadable playgrounds, here: what's new in Swift.
If you hit problems or have questions, you're welcome to tweet me @twostraws or email [email protected].