- Everyday Ergonomics
- Libraries
- Full-stack Swift
- Performance Ergonomics
- Open source development
Everyday Ergonomics
In Swift 5.6 you needed parentheses to make a protocol type optional with any or some. That limitation has now been lifted.
| Before | After |
|---|---|
![]() | ![]() |
There is a new warning when an error goes unhandled inside a Task.

The restriction on calling asynchronous functions inside defer blocks has been lifted.
| Before | After |
|---|---|
![]() | ![]() |
In your codebase you have probably seen the weak var pattern where var wasn't actually needed (a let would have done) but was used only so you could mark it weak. In Swift 6.2 Apple finally lets us write weak let — and doing so also allows the type to conform to Sendable. Two birds with one stone.

There is new syntax to opt out of a protocol or type — a way to say "not this type". The example below says "not Sendable".

Marking a subclass as not conforming to a protocol does not stop its own child classes from conforming to that protocol.

Previously, for types that had both internal and private properties, you had to write a private initializer and an internal initializer yourself. Now the Swift compiler generates both for you.

There is a new availability marker, anyAppleOS, for specifying version availability across all Apple platforms at once in your availability checks.
| Before | After |
|---|---|
![]() | ![]() |
On top of this default you can add exclusions by marking any of the platforms unavailable, or giving it a different version constraint.

This also applies to #-guarded code, to exclude code from compiling entirely.

There is a new @diagnostic declaration attribute that lets you silence or adjust compiler warnings gradually. It is quite useful — you can read more about it in the proposal: Source Warning Control.
Silencing warnings

Enabling a Swift concurrency feature for specific functions


There is a new module operator, similar to C. Previously you wrote Module.Type; you can now write Module::Type. This is especially useful when there is a type with the same name as a module and the compiler can't tell where to resolve the type from — in general, the dot syntax could mean either a type nested in another type or a module member.


import Rocket
import GiftShopToys
let rocket2 = Rocket.SaturnV() // ambiguous — prefers Rocket module's Rocket.SaturnV
let rocket3 = Rocket::SaturnV() // unambiguous — definitely Rocket module's SaturnV
There is a new task-cancellation shield block, withTaskCancellationShield, to perform an operation you want to run even when the task is being cancelled — for example, closing a connection to a database.

There is a new map-over-key-value function on dictionaries, to map over a dictionary and form a new one.
| Before | After |
|---|---|
![]() | ![]() |
There is also a unified file path that works across platforms.

Improvements to Swift Testing
You can now define the severity of an issue, rather than treating everything as a failure — test issues can be marked as warnings too.

You can also cancel a test midway, which is helpful for skipping a test for certain parameters.

There are new arguments on the swift test command to repeat a test.

XCTest and Swift Testing interoperability
XCTest assertions now surface as Swift Testing issues when run from swift test.

#expect now works inside XCTest class-based test functions.

You need to opt in for these behaviors.

There is more on migrating from XCTest to Swift Testing in the session: Migrate to Swift Testing.
Subprocess
The Subprocess Swift package, open sourced in 2025, has been bumped to version 1.9 with new features.

It can stream process output using AsyncStream.

Updates to the Foundation library
Foundation adds ProgressManager, a native solution for progress tracking and observation.
Reporting progress

Observing progress

It can also attach additional metadata (such as deltaV) to a Subprocess in a type-safe way.

Foundation is faster now, thanks to optimizations to sequences, using Span in for loops, reduced bridging between NSData and Data, and NSURL and CFURL now sharing the same implementation.
Full-stack Swift
You can now expose Swift functions to C and call them using @c, similar to @objc.

There is new Swift–Java interoperability using the swift-java package.

A demo of calling Swift functions from Kotlin using swift-java:

There is also a new Swift SDK for Android.
Updates to the VS Code Swift extension
It now works with the swiftly CLI, letting you choose a toolchain right from VS Code.

It also supports previewing DocC documentation in VS Code.

There is WASM support in Swift, along with updates to JavaScript interoperability.
There was also a mention of Goodnotes, a Singapore startup that built their entire app — iOS, Android, web, and even the backend — in Swift. For the web UI they used WASM.

For updates to embedded Swift, watch from this timestamp: Embedded Swift.
Performance Ergonomics
You get more control over compiler inlining. (To learn more about inlining, read Inlining and outlining in Swift.)

There is also explicit specialization. In simple terms, you ask the compiler to generate a typed version of your generic function. The compiler already does this a lot of the time when it has visibility into the codebase, but for libraries you may want to add @specialized to a generic function for the types you know it is most used with — this removes the overhead of the witness table. (To understand this better, read the proposal: Specialized.)

There is a replacement for the UnsafePointer approach to sharing storage and avoiding unnecessary copies, with the introduction of sending and borrowing. (Read more in the proposal: Parameter ownership modifiers. I also liked this article, which explains the concept with examples.)

One great point from the Swift team, worth re-iterating: Swift makes it easy to write good, performant code, and makes it possible to write the most performant code.

The Equatable, Comparable, and Hashable protocols can now be used on noncopyable and nonescapable types.


Associated types can now be noncopyable or nonescapable too.

In Swift 6.4, the for loop uses the same Iterable protocol mentioned above in place of the previous Sequence protocol.

The new Iterable accesses elements in batches of a Span rather than one by one, which improves the for loop in Swift 6.4.

There is also a new set of safe replacements for unsafe APIs.

Open source development
There is a new open source build system, Swift Build, that will power both Xcode and SwiftPM.

There are also new Swift workgroups for making open source contributions to the Swift language:







