chr*_*ags 5 async-await google-places-api swift firebase-storage
I am moving my swift project to Swift 5.5, taking advantage of async await and trying to learn the syntax effectively while I am at it.
I have been successful so far in moving some functions across - those within the FirebaseFirestore database: ".getDocuments()" and ".setData".
In these instances, the compiler recognizes what I am trying to do and suggests the 'async throws' version of the method, leaving out the completion parameter / closure. See screen shot here:
When I try to do the same thing with FirebaseStorage method ".getData" I am not presented with such an option, and in fact, adding "try await" with a "do / catch" gives my the compiler error: "Missing argument for parameter 'completion' in call"
我还在我的项目中使用了 GooglePlaces API,当我调用“.findAutocompletePredictions”和“.fetchPlace”时,也会发生同样的事情。在这些示例中,编译器抛出“调用中参数‘回调’缺少参数”
如何使用 swift 5.5 async wait 编写这些网络调用?
归档时间: |
|
查看次数: |
294 次 |
最近记录: |