最新发布第27页
多对多关系-Stewed Noodles 资源

多对多关系

在SwiftData 中,当关系的双方都使用数组时,就会创建多对多关系。这类关系相当常见,比如:一个老师有多个学生,一个学生可以有多个老师;一个演员参演了多部电影,一部电影也有许多演员参与;...
jiulinxiri的头像-Stewed Noodles 资源烩之面大会员jiulinxiri1年前
0130
更新数据-Stewed Noodles 资源

更新数据

在 SwiftData 中更新数据非常简单,默认情况会自动保存,无需手动调用保存操作。以下示例演示了创建一个 Student模型,并获取模型的数据进行更新,数据将自动保存: @Model class Student { var...
jiulinxiri的头像-Stewed Noodles 资源烩之面大会员jiulinxiri1年前
0130
withAnimation-Stewed Noodles 资源

withAnimation

使用提供的动画重新计算视图主体,并返回结果。 struct ContentView: View { @State private var isActive = false var body: some View { VStack(alignment: isActive ? .trailing : .leading)...
jiulinxiri的头像-Stewed Noodles 资源烩之面大会员jiulinxiri1年前
0130
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&...
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...
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 ...
工单类别-Stewed Noodles 资源

工单类别

巡检任务隐患过来的是检修工单 故障过来的是抢修工单 计划任务过来是计划工单 预防性维护过来的是预防性工单 检修与抢修工单 巡检人员在巡检的过程中,如果遇到故障,直接填报故障,等抢修完成...
jiulinxiri的头像-Stewed Noodles 资源烩之面大会员jiulinxiri7个月前
0130
RecyclerView-Stewed Noodles 资源

RecyclerView

RecyclerView 是 Android 中一个用于高效展示大量列表数据的强大控件,是 ListView 的升级版。它具有更好的性能、更灵活的布局管理方式,并且支持强大的扩展能力。 RecyclerView 会回收这些独立...
jiulinxiri的头像-Stewed Noodles 资源烩之面大会员jiulinxiri3个月前
0130
Class-Stewed Noodles 资源

Class

带构造函数的类 /** * 带构造函数的类 */ class Robot(val name: String) { fun greetHuman() { println('Hello human, my name is $name') } fun walk() { println('I'm walking') } } // 类对...
Data Class 数据类-Stewed Noodles 资源

Data Class 数据类

Kotlin 中的 数据类(data class) 是一种用于只存数据的类,能够自动生成常用的函数。 equals() hashCode() toString() copy() 语法 data class ClassName( val prop: Type, var prop2: Type )...