twostraws / whats-new-in-swift-5-7

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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:

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 paul@hackingwithswift.com.

Screenshot of Xcode 14.0 running this playground.

About


Languages

Language:Swift 100.0%