jiulinxiri-Stewed Noodles 资源-第16页
jiulinxiri的头像-Stewed Noodles 资源
超级管理员河南管理员
一拳之石取其了坚,一勺之水取其净!
模型容器-Stewed Noodles 资源

模型容器

ModelContainer 是 SwiftData 中负责创建和管理实际数据库文件的核心组件。它提供了集中化的存储方案,确保数据的持久化和高效访问。ModelContainer 处理数据模型的定义、数据库文件的生成与管...
使用 @Model 宏定义模型-Stewed Noodles 资源

使用 @Model 宏定义模型

您将使用 @Model 宏来定义所有 SwiftData 模型类。该宏会自动使您的类能够从 SwiftData 加载和存储数据,支持观察更改,并添加 Hashable、Identifiable、Observable 和 PersistentModel 的遵循...
模型迁移-Stewed Noodles 资源

模型迁移

当你更改数据模型时,SwiftData 可以自动处理模型更新,也可以通过手动干预进行复杂的迁移。 自动处理更新迁移 以下是一些常见的小修改,SwiftData 会自动处理这些模型更新: 添加一个或多个新...
phaseAnimator-Stewed Noodles 资源

phaseAnimator

一个容器,通过自动循环遍历你提供的一系列阶段来对其内容进行动画处理,每个阶段定义了动画中的一个离散步骤。 具有阶段动画的弹跳 例如,前面展示的表情符号弹跳动画具有两个阶段:向上移动和...
5个月前
070
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 ...
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...
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...
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...
How to manipulate an AsyncSequence using map(), filter(), and more 如何使用 map()、filter() 等作 AsyncSequence-Stewed Noodles 资源

How to manipulate an AsyncSequence using map(), filter(), and more 如何使用 map()、filter() 等作 AsyncSequence

AsyncSequence has implementations of many of the same methods that come with Sequence, but how they operate varies: some return a single value that fulfills you...
What’s the difference between a task and a detached task? 任务和分离任务有什么区别?-Stewed Noodles 资源

What’s the difference between a task and a detached task? 任务和分离任务有什么区别?

If you create a new task using the regular Task initializer, your work starts running immediately and inherits the priority of the caller, any task local values, and its ...