Can I use async/await under iOS15.0?

As I can see, all the async APIs in XCode13.0 beta requires a deployment target of iOS 15.0, is that means that I cannot use async/await under iOS 15.0?

Replies

Yes... I also tried this earlier and it looks like you can only use this features only on the new beta operating systems. It's a shame... I don't see why async/await is binded to the os. I think this is just a swift feature hidden under some os version flags. I wonder if the apple developers can come with more details why can't we use this in for eg. ios14.

Probably it will take at least one year until it will be widely adopted. I guess this is how apple forces us to constantly update our software stack.

There's some discussion about the same issue on forums.swift.org .

Will Swift Concurrency deploy back to older OSs?

It seems to be true that the runtime needed for await/async is provided as part of the new OSs.

It is a very sad fact that most of us developers need years to adopt this bright and successful new feature. My company follows three-generation policy to support older OSs, which means we can use async/await when iOS 17 will be out. I cannot be sure if I could remember that we could use this feature three years from now.

Apple should consider backward compatibility more severely to make this sort of great feature more popular in apps.

Paul Hudson from Hacking with Swift has a nice answer on this from 11/28/2021:

When it was originally announced, Swift concurrency required at least iOS 15, macOS 12, watchOS 8, tvOS 15, or on other platforms at least Swift 5.5.

However, if you’re building your code using Xcode 13.2 or later you can back deploy to older versions of each of those operating systems: iOS 13, macOS 10.15, watchOS 6, and tvOS 13 are all supported. This offers the full range of Swift functionality, including actors, async/await, the task APIs, and more.

Important: This backwards compatibility applies only to Swift language features, not to any APIs built using those language features. This means you can write your own code to use async/await, actors, and so on, but you won’t automatically gain access to the new Foundation APIs using those – things like the new URLSession APIs that use async/await still require iOS 15.

https://www.hackingwithswift.com/quick-start/concurrency/where-is-swift-concurrency-supported

It works in after iOS 13.0 with Xcode 13.2.1 !