IOS Apollo, Swift 5.5 async await


I see that swift is now coming with async and await, and i was wondering if the Apollo Library going to support this in the future? And if, when?

Best regards
Alexander Larsen

Great question! The short answer is we definitely plan to support it, but when is pretty unclear at this point.

One major factor is whether Apple actually winds up creating a way to support this on older versions of the various operating systems. It at least looks like they’re trying, but it’s not clear when and how it’s going to land. With current betas, it only supports iOS 15+ and the other operating systems which are still in beta, and Apollo currently supports 12+. Even if Apple’s current attempt does land, it does appear it’d be 13+, so we’d need to make some decisions around that as well.

If you’re super-eager to get started, wrapping the closure-based APIs with continuations is probably the place to start. We could look at putting some kind of wrapper library together that does this for you once we’ve managed to nail down some more stuff on our 1.0 roadmap, but again, I can’t commit to a timeline on that. We do always love community contributions though, and if you’re interested in trying to make this work, we’d be happy to work with you!

There’s potentially large advantages for us in adapting async/await internally, though, so we are certainly incentivized to consider doing this sooner rather than later if Apple can make the backport work.

1 Like