最新发布第29页
排序
How to test completion handlers with Swift Testing and XCTest 如何使用 Swift Testing 和 XCTest 测试补全处理程序
When you're dealing with older concurrency code that relies on callback functions that get run when some work completes rather than using Swift concurrency's async/await ...
How to test AsyncSequence and AsyncStream 如何测试 AsyncSequence 和 AsyncStream
Concurrent Swift code often streams values over time rather than returning them all at once, so it's important to be able to write tests to check an AsyncStream, AsyncSeq...
物资、设备与资产
物资设备与资产 采购阶段 在采购阶段设备以物资的形式呈现,采购阶段主要是物资的采购、到货以及验收。物资形式下的设备拥有物资编码。 设备建档 物资采购完成后,可以进行设备建档,设备建档会...
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 ...
级联关系删除
SwiftData 默认的关系删除规则是.nullify,这意味着如果一个 School 对象与多个 Student对象关联,删除 School 后,学生对象仍会保留在数据存储中。在某些情况下这是合理的,但你也可以使用.cas...
关系最大最小约束
SwiftData 的 @Relationship 宏允许我们指定一对多或多对多连接中应存在的最小和最大对象数量。 超出这些限制时,SwiftData 的自动保存将静默失败,可能导致数据丢失,除非及时进行纠正。 例如...
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&...
What are tasks and task groups? 什么是任务和任务组?
Using async/await in Swift allows us to write asynchronous code that is easy to read and understand, but by itself it doesn’t enable us to run anything concurrently – even w...



