I last wrote Swift in 2019. What new language features have there been since then that I should know about?
Asked on 07/23/2024
1 search
Since you last wrote Swift in 2019, there have been several significant updates and new features introduced to the language. Here are some of the key changes:
- Concurrency Model: Introduced in 2020, Swift's concurrency model includes
async/await
, actors, and structured concurrency. This model helps in writing safer and more efficient concurrent code. - Distributed Actors: Introduced in 2021, distributed actors make it easier to build network services by providing a safer and more structured way to handle distributed systems.
- Bi-Directional Interoperability with C: Introduced last year, this feature allows for easier integration of Swift with C codebases, enhancing Swift's expressivity and safety.
- Macros: Also introduced last year, macros help reduce repetitive boilerplate code and enable more expressive APIs.
- Swift 6: The latest version, Swift 6, introduces several new features:
- Swift 6 Language Mode: Provides data race safety guarantees, which help in writing correct concurrent programs.
- Non-Copyable Types: A new feature that allows certain types to be non-copyable, enhancing performance and safety.
- Embedded Swift: A new language subset designed to run on highly constrained systems, such as those in smart home devices.
- C++ Interoperability: Enhances the ability to work with C++ code, making Swift more versatile in mixed-language projects.
- Typed Throws: Introduces a way to specify the types of errors that can be thrown, making error handling more precise and safer.
For a detailed overview of these updates, you can refer to the session "What’s new in Swift" starting at 17:03.
Relevant Sessions

Platforms State of the Union 5-Minute Recap
Watch a quick recap of the newest advancements on Apple platforms.

What’s new in Swift
Join us for an update on Swift. We’ll briefly go through a history of Swift over the past decade, and show you how the community has grown through workgroups, expanded the package ecosystem, and increased platform support. We’ll introduce you to a new language mode that achieves data-race safety by default, and a language subset that lets you run Swift on highly constrained systems. We’ll also explore some language updates including noncopyable types, typed throws, and improved C++ interoperability.

A Swift Tour: Explore Swift’s features and design
Learn the essential features and design philosophy of the Swift programming language. We’ll explore how to model data, handle errors, use protocols, write concurrent code, and more while building up a Swift package that has a library, an HTTP server, and a command line client. Whether you’re just beginning your Swift journey or have been with us from the start, this talk will help you get the most out of the language.