AppCode: Alamofire with Swift Async/Await: "request.serializingString().response" not available

593 Views Asked by At

I'm writing this because it caused me a few hours of work today. I figured it out so now maybe somebody else won't waste any time.

I'm an iOS developer and I use AppCode instead of Xcode.

I'm in the process of trying to update our app using Swift's new concurrency features. We use Alamofire for REST stuff.

The problem:

Trying to use Alamofire's concurrency methods in AppCode don't show up as valid methods. The IDE/Compiler didn't recognize the methods.

In my case, it was .serializingString().

2

There are 2 best solutions below

0
James Futures On

Something about the Alamofire package isn't playing nice with AppCode.

It all works just fine. You can write the code in AppCode, even though the IDE won't appear to understand what you're doing.

I switched over to Xcode and everything looked nice. I ran it and it worked.

2
Jon Shier On

Alamofire's Concurrency support requires Swift 5.6 as of Alamofire 5.6. If AppCode's compiler is behind it will report them as unavailable, as it can't see into the swift(>=5.6.0) block.