jiulinxiri-Stewed Noodles 资源-第10页
jiulinxiri的头像-Stewed Noodles 资源
超级管理员河南管理员
一拳之石取其了坚,一勺之水取其净!
How to store continuations to be resumed later 如何存储要稍后恢复的 continuations-Stewed Noodles 资源

How to store continuations to be resumed later 如何存储要稍后恢复的 continuations

Many of Apple’s frameworks report back success or failure using multiple different delegate callback methods rather than completion handlers, which means a simple continuation won...
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 ...
What is an asynchronous function?什么是异步函数?-Stewed Noodles 资源

What is an asynchronous function?什么是异步函数?

Although Swift functions are synchronous by default, we can make them asynchronous by adding one keyword: async. Inside asynchronous functions, we can call other asy...
What is a synchronous function? 什么是同步函数?-Stewed Noodles 资源

What is a synchronous function? 什么是同步函数?

By default, all Swift functions are synchronous, but what does that mean? A synchronous function is one that executes all its work in a simple, straight line on a single threa...
How to use continuations to convert completion handlers into async functions 如何使用 continuations 将完成处理程序转换为异步函数-Stewed Noodles 资源

How to use continuations to convert completion handlers into async functions 如何使用 continuations 将完成处理程序转换为异步函数

Older Swift code uses completion handlers for notifying us when some work has completed, and sooner or later you’re going to have to use it from an async function –&nbs...
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 ...
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...
Sending data safely across actor boundaries 跨参与者边界安全地发送数据-Stewed Noodles 资源

Sending data safely across actor boundaries 跨参与者边界安全地发送数据

Swift tries to ensure access to shared data is done safely, partly through types such as actors, and partly through a concept of sendability implemented through the ...
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...
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&...