Swift 6.2 Approachable Concurrency in SwiftUI Apps
Swift 6's data-race safety was a big win and a lot of friction. App code ended up covered in @MainActor, Sendable and nonisolated, often for code that never needed to leave the main thread. Swift 6.2, which shipped with Xcode 26 in September 2025, changed the defaults so the simple case is simple again. Apple calls the set of changes approachable concurrency.
The idea: most app code is single-threaded UI code, so start there and opt into parallelism where you actually want it, instead of the other way round.
1. Main actor by default
A module can now make the main actor its default isolation. Everything in it that isn't explicitly marked otherwise (types, functions, global variables) is @MainActor. New app projects in Xcode 26 turn this on; for existing targets it's the Default Actor Isolation build setting. In a Swift package:
// Package.swift
.target(
name: "AppFeature",
swiftSettings: [.defaultIsolation(MainActor.self)]
)With it on, this compiles in Swift 6 mode with no annotations at all:
@Observable
final class LibraryModel {
var books: [Book] = []
var isLoading = false
func reload() async throws {
isLoading = true
defer { isLoading = false }
books = try await BookAPI.fetchAll()
}
}
struct LibraryView: View {
@State private var model = LibraryModel()
var body: some View {
List(model.books) { Text($0.title) }
.task { try? await model.reload() }
}
}LibraryModel is implicitly @MainActor, so the view can use it freely and its state can't be touched from a background thread.
Keep this setting for app and UI targets. For library modules that do real background work, the old default, nonisolated, is still the right one.
2. Async functions run where they're called
In Swift 6.0, a nonisolated async function always hopped off the caller's actor onto the global concurrent executor. That's why calling an async helper from the main actor so often produced "sending non-Sendable value" errors: the arguments had to cross to another thread.
With the NonisolatedNonsendingByDefault feature (part of approachable concurrency), a nonisolated async function runs on the caller's actor by default. Call it from the main actor and it stays there; nothing crosses, so nothing needs to be Sendable.
struct ImageCache {
func thumbnail(for item: Item) async -> Image {
// Runs on whichever actor called it. From a view, that's the main actor.
await item.loadThumbnail()
}
}Awaiting URLSession or other async system APIs still doesn't block the main thread: the work they do happens elsewhere, and only your code around the await runs on the main actor.
3. @concurrent when you really want a background thread
For CPU-heavy work that should get off the main actor, say so explicitly with @concurrent. It always runs on the concurrent pool, so its inputs and outputs need to be Sendable:
struct ImageProcessor {
@concurrent
func blurred(_ data: Data, radius: Double) async -> Data {
// Decoding and filtering a large image: keep it off the main actor.
applyBlur(to: data, radius: radius)
}
}
// With main-actor-by-default, helpers that run in the background must say so.
nonisolated func applyBlur(to data: Data, radius: Double) -> Data {
// … Core Image work …
data
}
// From a view or a main-actor model:
let result = await ImageProcessor().blurred(photoData, radius: 12)Anything a @concurrent function calls must be nonisolated too; in a main-actor-by-default module, the compiler will point out every helper you forgot. This flips the old default around: background execution is now something you ask for where it pays off, instead of something you defend against everywhere.
4. Isolated conformances
A main-actor type often needs to conform to a protocol whose requirements aren't isolated, such as Equatable or a delegate protocol. Swift 6.2 lets the conformance itself be isolated, and the compiler makes sure it's only used on that actor:
@MainActor
final class Session {
var token = ""
}
extension Session: @MainActor Equatable {
static func == (lhs: Session, rhs: Session) -> Bool {
lhs.token == rhs.token
}
}With approachable concurrency turned on, the compiler infers this for main-actor types, so you usually don't write the attribute at all.
Turning it on
In Xcode 26, select your target, open Build Settings, and set:
- Default Actor Isolation: MainActor (app and UI targets)
- Approachable Concurrency: Yes
Then build and expect to delete annotations rather than add them: @MainActor on view models, nonisolated on helpers, and Task { @MainActor in … } wrappers become redundant.
Other things in Swift 6.2
InlineArray<N, Element>: a fixed-size array stored inline, with no heap allocation, for performance-sensitive code.Span: safe, non-escaping access to contiguous memory, replacing many unsafe pointer uses.- The
Subprocesspackage for running external processes, and WebAssembly support.
Summary
| Before (Swift 6.0) | With approachable concurrency (6.2) |
|---|---|
@MainActor on every view model |
Main actor is the module default |
| Async helpers hop to a background thread | They run on the caller's actor |
| "Sending non-Sendable value" errors in UI code | Mostly gone: nothing crosses |
| Background work by accident | Background work with @concurrent, on purpose |
If you put off adopting the Swift 6 language mode because of the annotation burden, 6.2 is the release to try it again. For the original Swift 6 changes, see What's new in Swift 6.0.
Building SwiftUI screens with an AI agent? Clean concurrency is half of it; consistent design is the other half. Effect UI gives your agent a design system to follow.