I’ve an older mission that was created earlier than Xcode 26.2.
In Xcode variations previous to 26.2, there was no Swift Compiler – Concurrency construct setting.

With these older variations, the next habits happens: a nonisolated perform executes off the principle thread.
class ViewController: UIViewController {
override func viewDidLoad() {
tremendous.viewDidLoad()
run()
}
personal func run() {
Activity {
await runInMainThread()
}
}
func runInMainThread() async {
print(">>>> IN runInMainThread(), Thread.isMainThread (Thread.isMainThread)")
await runInBackgroundThread()
}
personal nonisolated func runInBackgroundThread() async {
print(">>>> IN runInBackgroundThread(), Thread.isMainThread (Thread.isMainThread)")
}
}
Output:
>>>> IN runInMainThread(), Thread.isMainThread true
>>>> IN runInBackgroundThread(), Thread.isMainThread false
Nonetheless, beginning with Xcode 26.2, Apple launched the Swift Compiler – Concurrency settings.

When working the identical code with the default configuration:
Approachable Concurrency = Sure
Default Actor Isolation = MainActor
That is the output
Output:
>>>> IN runInMainThread(), Thread.isMainThread true
>>>> IN runInBackgroundThread(), Thread.isMainThread true
the nonisolated perform now executes on the major thread.
This raises the next questions:
-
What’s the right Swift Compiler – Concurrency configuration if I need a
nonisolatedperform to run off the principle thread? -
Is
nonisolatednonetheless an applicable manner to make sure code runs on a background thread?

