Avatar
@swift-5.6.3 import Foundation func nonIsolatedFunc() async { print(Thread.isMainThread) try? await Task.sleep(nanoseconds: 1_000) print(Thread.isMainThread) } @MainActor func mainIsolatedFunc() async { await nonIsolatedFunc() print("aaa") } Task { await mainIsolatedFunc() }