Xcode 13 beta 2 (13A5155e) uses two different versions of Concurrency for iOS and other platforms (e.g. macOS, watchOS, tvOS)

It is ridiculous to use two different versions of Concurrency API for different platforms.

Xcode 13 beta 2 (13A5155e) uses two different versions of Concurrency for iOS and other platforms (e.g. macOS, watchOS, tvOS)!

 //
//  TestAsyncApp.swift
//  Shared
//
//

import SwiftUI

@main
struct TestAsyncApp: App {
    var body: some Scene {
        WindowGroup {
            ContentView()
        }
    }
    
    @available(iOS 15.0, macOS 12.0, watchOS 8.0, tvOS 15.0, *)
    func testAsync() {

        #if os(macOS) ||  os(watchOS) || os(tvOS)
         // will trigger error for iOS
        Task {
        }
        Task.detach {
        }

        #elseif os(iOS)
        // will trigger deprecated warning for macOS, watchOS and tvOS
        async {
        }
        asyncDetached {
        }
        #endif
    }
}
  • Thank you for providing a workaround for now. This at least cleans up the warnings.

Add a Comment

Replies

Yes, it’s clearly a problem for the new API to vary based on the platform, but I’m not quite sure what your goal is here:

  • If you’re asking whether this is the final plan then let me assure you that it is not.

  • If you’re asking for a workaround, it seems you’ve already found one. It’s horrible, but it’ll get you unblocked.

  • If you’re trying to file a bug report then… well… normally I’d recommend that you do that officially but in this case there’s not much point because this is a well-known issue.

Swift concurrency is evolving rapidly and it’s hard to make sure that all the spinning plates are spinning at the same rate )-:

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

  • Thank you for the timely answer. I just filed a bug, but I suppose since it's well-known, I should close it. FYI: FB9218851

Add a Comment