Swift 6.2: Concurrency Finally Made Accessible

Published on Β· 12 min

Wlad
Wlad
Founder & Swift Tech Lead

Announced at WWDC 2025 and shipped with Xcode 26 in September, Swift 6.2 marks a turning point in Swift concurrency history. After years of complaints about the model's complexity, Apple responds with "Approachable Concurrency": a set of changes that finally make asynchronous programming accessible to everyone.

The realization that changed everything

Let's be honest: Swift Concurrency had become a problem. Introduced with Swift 5.5, the model promised safety and performance. In practice, it imposed a brutal learning curve and generated incomprehensible errors even for simple, single-threaded code.

The "Improving the approachability of data-race safety" document published by the Swift team explicitly acknowledges this problem. Swift 6.2 is the concrete answer: a set of coordinated proposals to reduce friction without sacrificing safety.

The main changes:

  • MainActor by default with SE-0466

  • Async functions on the caller's actor with SE-0461

  • New @concurrent attribute for explicit opt-in

  • Isolated conformances with SE-0470

  • Isolated deinit with SE-0371

MainActor by default: the game changer

SE-0466 is probably the most impactful change in Swift 6.2. It allows configuring an entire module to run on MainActor by default, eliminating at once the majority of concurrency errors in UI apps.

The problem before Swift 6.2

With Swift 6.2 and defaultIsolation

In Xcode 26, new projects have this option enabled by default. For existing projects, enable it in Build Settings β†’ Swift Compiler β†’ Default Actor Isolation.

What this changes in practice

With defaultIsolation set to MainActor, the compiler treats all code without explicit annotation as if it were marked @MainActor. Your types, functions, and properties run on the main thread unless otherwise specified.

Some important points:

  • External modules are not affected β€” they keep their isolation

  • URLSession and other network APIs continue to work normally

  • You can still create Tasks for concurrent work

  • Opt-out remains possible with nonisolated or @concurrent

Async on the caller's actor

SE-0461 solves a subtle but frustrating problem: non-isolated async functions automatically jumped to a background thread, even when called from MainActor.

Before Swift 6.2

With Swift 6.2

This behavior is enabled via the upcoming feature NonisolatedNonsendingByDefault in Xcode 26.

@concurrent: explicit opt-in

If you want a function to truly run in parallel, Swift 6.2 introduces the @concurrent attribute to be explicit.

This distinction makes code much more readable: you know exactly when a function will leave the current actor.

Isolated conformances to global actors

SE-0470 solves a recurring problem: how to conform a type to a protocol while respecting isolation?

The problem

The solution with Swift 6.2

With the upcoming feature InferIsolatedConformances, Swift can even infer this isolation automatically in many cases.

Isolated deinit for actors

SE-0371 finally allows marking deinit as isolated, solving a long-standing problem with resource cleanup.

Without the isolated keyword, deinit wouldn't have safe access to the class properties.

Inline Arrays: compile-time performance

Swift 6.2 introduces Inline Arrays, fixed-size arrays whose size is known at compile time.

Inline Arrays are particularly useful for C/C++ interoperability and cases where memory performance is critical.

Span: safe alternative to pointers

The new Span type (SE-0447) provides a non-owning view over a contiguous memory region, without the dangers of unsafe pointers.

Span is a non-escapable type: it cannot be stored beyond its creation scope. It is not Sequence β€” iteration is done via indices and subscript.

Subprocess: simplified Swift scripts

The new Subprocess package makes it easy to launch external processes from Swift.

run() is a global function from the module. Use .name() for a command name (PATH lookup) or .path() for an absolute path. The output: parameter must be specified to collect output.

This package is available in version 0.1 and welcomes community feedback.

Extended interoperability

Swift 6.2 significantly improves interoperability with other languages.

Improved C++

swift-java: Swift in Java

The swift-java project allows using Swift from Java code, opening new possibilities for backend developers.

Migrating from Swift 6.1

Enabling Approachable Concurrency

For an existing Xcode project:

    • Build Settings β†’ Swift Compiler β†’ Upcoming Features
    • Enable "Approachable Concurrency"
    • Build Settings β†’ Default Actor Isolation β†’ MainActor

For a Swift Package:

Points to watch

Some patterns may require adjustments:

Going further

Swift 6.2 represents a philosophy change: instead of forcing everyone to understand concurrency immediately, it becomes opt-in. You can write modern, safe Swift code without being overwhelmed by threading concepts.

Official resources