Async/await 第2页
How to fix the error “async call in a function that does not support concurrency” 如何修复错误 “async call in a function that does not support concurrency”-Stewed Noodles 资源

How to fix the error “async call in a function that does not support concurrency” 如何修复错误 “async call in a function that does not support concurrency”

This error occurs when you’ve tried to call an async function from a synchronous function, which is not allowed in Swift – asynchronous functions must be able to suspend the...
jiulinxiri的头像-Stewed Noodles 资源烩之面大会员jiulinxiri8个月前
110
What’s the difference between await and async let? await 和 async let 有什么区别?-Stewed Noodles 资源

What’s the difference between await and async let? await 和 async let 有什么区别?

Swift lets us perform async operations using both await and async let, but although they both run some async code they don’t quite run the same: await wai...
jiulinxiri的头像-Stewed Noodles 资源烩之面大会员jiulinxiri8个月前
0100
How to create continuations that can throw errors 如何创建可以抛出错误的continuations-Stewed Noodles 资源

How to create continuations that can throw errors 如何创建可以抛出错误的continuations

Swift provides withCheckedContinuation() and withUnsafeContinuation() to let us create continuations that can’t throw errors, but if the API you’re using ...
jiulinxiri的头像-Stewed Noodles 资源烩之面大会员jiulinxiri8个月前
100
How to call an async function using async let 如何使用 async let 调用 async 函数-Stewed Noodles 资源

How to call an async function using async let 如何使用 async let 调用 async 函数

Sometimes you want to run several async operations at the same time then wait for their results to come back, and the easiest way to do that is with async let. This lets you start...
jiulinxiri的头像-Stewed Noodles 资源烩之面大会员jiulinxiri8个月前
90
Why can’t we call async functions using async var? 为什么我们不能使用 async var 调用 async 函数?-Stewed Noodles 资源

Why can’t we call async functions using async var? 为什么我们不能使用 async var 调用 async 函数?

Swift’s async let syntax provides short, helpful syntax for running lots of work concurrently, allowing us to wait for them all later on. However, it only works as ...
jiulinxiri的头像-Stewed Noodles 资源烩之面大会员jiulinxiri8个月前
050