When migrating a large UIKit/SwiftUI project to Swift 6.2, what is the most effective new feature to reduce the boilerplate of `@MainActor` annotations?
iOS interview question for Intermediate practice.
Answer
Setting a module-wide default actor isolation to MainActor in the build settings.
Explanation
SE-0466 introduces a module-level setting for default actor isolation to address the boilerplate of annotating countless items with @MainActor. By configuring this in Xcode's build settings or the Package.swift manifest, all applicable code within that module is implicitly treated as if it were marked @MainActor, making the code single-threaded by default and dramatically reducing boilerplate.