XuX-Stewed Noodles 资源-第22页
XuX的头像-Stewed Noodles 资源
超级管理员河南管理员
一拳之石取其了坚,一勺之水取其净!
文档竖版标签-Stewed Noodles 资源

文档竖版标签

文档竖版标签样式,如下所示 文档竖版标签.docx下载docx文件14.1K  
1年前
0250
查询数据-Stewed Noodles 资源

查询数据

SwiftData 提供了 @Query 宏,用于从 SwiftUI 视图中查询模型对象,并可选择提供排序顺序、过滤谓词,以及用于平滑处理结果变化的自定义动画或自定义事务。更棒的是,@Query 会在每次数据变化时...
如何动态更改查询的排序顺序或谓词-Stewed Noodles 资源

如何动态更改查询的排序顺序或谓词

要实现动态排序,您需要将@Query属性移至 SwiftUI 层次结构中的视图中 - 您需要将其放入子视图中,在其中可以使用依赖项注入提供排序值。 这意味着创建一个新的 SwiftUI,它使用@Query来显示您...
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...
How to create and use task local values 如何创建和使用任务本地值-Stewed Noodles 资源

How to create and use task local values 如何创建和使用任务本地值

Swift lets us attach metadata to a task using task-local values, which are small pieces of information that any code inside a task can read.Swift 允许我们使用 task-local ...
How to handle concurrency errors in unit tests 如何处理单元测试中的并发错误-Stewed Noodles 资源

How to handle concurrency errors in unit tests 如何处理单元测试中的并发错误

Both Swift Testing and XCTest give us three main options for handling errors in tests: we can consider them immediate failures, we can handle them internally and make our own asser...
How to set a time limit for concurrent tests 如何为并发测试设置时间限制-Stewed Noodles 资源

How to set a time limit for concurrent tests 如何为并发测试设置时间限制

Both Swift Testing and XCTest have simple mechanisms for controlling how long tests should be allowed to run before being considered a failure. This is critically important for con...
Live Data-Stewed Noodles 资源

Live Data

基本介绍 LiveData 是一个可观察的数据持有类。与普通的可观察对象不同,LiveData 具备生命周期感知能力,也就是说它会遵循应用中其他组件(如 Activity、Fragment 或 Service)的生命周期。 这...
it 关键字-Stewed Noodles 资源

it 关键字

当 Lambda 表达式或匿名函数只接收 一个参数 时,it 会作为这个参数的 隐式名称(默认参数名)。 val numbers = listOf(1, 2, 3, 4, 5) // it 表示参数 println(numbers.map { it * it }) // [1...