Menu

1 / 2

Default MainActor Isolation and nonisolated(nonsending) in Practice: migrating a real iOS app layer to Approachable Concurrency

DEV Community: ios·Dheerendra Chaturvedi·3 days ago
#fFRD0Ydv
Long article (1753 words) — no AI summary yet.
Reading 0:00
15s threshold

This continues the "…in Practice" series. In the earlier actors post I converted a view model and a cache to explicit @MainActor and spent most of the time chasing Sendable errors and inserting MainActor.run hops. Swift 6.2's Approachable Concurrency settings are meant to remove most of that ceremony: you declare that a module is main-actor by default, and the annotations mostly disappear. I wanted to see what that actually does to real code, where it changes behavior silently, and which diagnostics you hit on the way. So I built the same small app layer twice — once the old way, once migrated — and read every compiler error out loud.

Everything below is copied from a package that builds with swift build -c release at zero warnings and whose tests pass.

Toolchain: Apple Swift 6.2.4 (swiftlang-6.2.4.1.4 clang-1700.6.4.2), Xcode 26.3 (17C529), macOS 15.7.4, x86_64.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.