AwaitKit
AwaitKit copied to clipboard
AwaitKit doesn't compile in Xcode 13 / Swift 5.5
The introduction of async/await in Swift 5.5 (https://github.com/apple/swift-evolution/blob/main/proposals/0296-async-await.md) promoted the "await" word to keyword. Therefore to use it in the context of function call, it must be wrapped in backticks, just as for the methods called with other language keywords.
I've made a PR that adds the backticks in the right place: https://github.com/yannickl/AwaitKit/pull/57
Change is compatible with previous Swift versions.
Oh great! Let me check your PR, thanks.
new release?
A new release would be interesting...
Yeah a new release would be great @yannickl - using master branch directly for now.
Yeah a new release would be great @yannickl - using master branch directly for now.
I just got an error near the 'async', how do you solve this issue?

Yeah, Xcode 13 broke a bunch of things for us as well:
async { try await(...)}-> 'async(priority:operation:)' is only available in iOS 15.0 or newerreturn Promise<AVURLAsset?> { seal in ...-> Cannot pass function of type '(Resolver<AVURLAsset?>) async -> Void' to parameter expecting synchronous function type
Yeah, Xcode 13 broke a bunch of things for us as well:
async { try await(...)}-> 'async(priority:operation:)' is only available in iOS 15.0 or newerreturn Promise<AVURLAsset?> { seal in ...-> Cannot pass function of type '(Resolver<AVURLAsset?>) async -> Void' to parameter expecting synchronous function type
I got an easier way to solve it. I download the source code and copy them to my project. then I renamed all 'async' and 'await' keywords, I added the prefix 'ak', so now I just need to call 'akasync' and 'akawait'.
Installing Xcode 12 and 13 in parallel (just rename it before copying into applications folder) allows building with Xcode 12 for iOS 15 with no issues.
I can confirm that by installing the lib with #57 merged and wrapping every async/await in the project with back-ticks, it is possible to compile on Xcode 13.
- pod 'AwaitKit', '~> 5'
+ pod 'AwaitKit', :git => 'https://github.com/yannickl/AwaitKit.git', :branch => 'master'
- return async {
+ return `async` {
- try await(...)
+ try `await`(...)
@yannickl Is there a chance for a new version release with @siejkowski support for Swift 5.5 / Xcode 13 soon?
Hi,
could you make a new tag soon with Swift 5.5/Xcode 13 fix? It is needed if I want to use component through swift package manager.
Thanks.