Async/await 第2页
How to create and use async properties 如何创建和使用异步属性-Stewed Noodles 资源

How to create and use async properties 如何创建和使用异步属性

Just as Swift’s functions can be asynchronous, computed properties can also be asynchronous: attempting to access them must also use await or similar, and may also need&...
jiulinxiri的头像-Stewed Noodles 资源烩之面大会员jiulinxiri5个月前
050
What’s the performance cost of calling an async function? 调用 async 函数的性能成本是多少?-Stewed Noodles 资源

What’s the performance cost of calling an async function? 调用 async 函数的性能成本是多少?

Whenever we use await to call an async function, we mark a potential suspension point in our code – we’re acknowledging that it’s entirely possible our function w...
jiulinxiri的头像-Stewed Noodles 资源烩之面大会员jiulinxiri5个月前
70
What calls the first async function? 什么调用第一个异步函数?-Stewed Noodles 资源

What calls the first async function? 什么调用第一个异步函数?

You can only call async functions from other async functions, because they might need to suspend themselves and everything that is waiting for them. This leads to a bit of a chicke...
jiulinxiri的头像-Stewed Noodles 资源烩之面大会员jiulinxiri5个月前
0140
How to call async throwing functions 如何调用异步 throwing 函数-Stewed Noodles 资源

How to call async throwing functions 如何调用异步 throwing 函数

Just like their synchronous counterparts, Swift’s async functions can be throwing or non-throwing depending on how you want them to behave. However, there is a twist: although we ...
jiulinxiri的头像-Stewed Noodles 资源烩之面大会员jiulinxiri5个月前
070
How to create and call an async function如何创建和调用异步函数-Stewed Noodles 资源

How to create and call an async function如何创建和调用异步函数

Using async functions in Swift is done in two steps: declaring the function itself as being async, then calling that function using await.在 Swift 中使用异步函数分两步完...
jiulinxiri的头像-Stewed Noodles 资源烩之面大会员jiulinxiri5个月前
050