最新发布第24页
删除数据-Stewed Noodles 资源

删除数据

删除 SwiftData 对象需要两个步骤:首先在你的模型上下文上调用 delete()方法,并传入你想要删除的对象;然后保存更改,可以通过显式调用 save(),或者如果启用了自动保存,则等待自动保存触发...
Animation-Stewed Noodles 资源

Animation

当指定的值发生变化时,将给定的动画应用于此视图。 struct ContentView: View { @State private var scale = 0.5 var body: some View { VStack { Circle().scale(scale).animation(.easeIn, v...
XuX的头像-Stewed Noodles 资源烩之面大会员XuX1年前
0230
Transaction-Stewed Noodles 资源

Transaction

当前状态处理更新的上下文。 transaction(value:_:) 使用.transaction 修饰符来更改或替换视图中使用的动画。考虑一个由按钮控制的三个相同视图,同时改变所有三个的情况: 第一个视图通过旋转...
XuX的头像-Stewed Noodles 资源烩之面大会员XuX1年前
0230
How to cancel a task group 如何取消任务组-Stewed Noodles 资源

How to cancel a task group 如何取消任务组

Swift’s task groups can be cancelled in one of three ways: if the parent task of the task group is cancelled, if you explicitly call cancelAll() on the group, or if one of your ...
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...
Manifest 文件-Stewed Noodles 资源

Manifest 文件

Manifest.xml 文件是重要的配置文件,提供了Android 应用程序的基本信息。 <?xml version='1.0' encoding='utf-8'?> <!--配置清单的开始标记--> <manifest xmlns:android='http://sche...
Fragment-Stewed Noodles 资源

Fragment

基本介绍 Fragment 代表应用程序 UI 可复用的部分。Fragment 定义和管理自己的布局,拥有自己的生命周期,并且可以处理自己的输入事件。Fragment 不能独自存在,它们必须由一个 Activity 或者另...
Live Data-Stewed Noodles 资源

Live Data

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

高阶函数

高阶函数可以接受一个或多个函数作为参数,也可以讲一个函数作为返回值。 fun operateOnNumbers(a: Int, b: Int, operation: (Int, Int) -> Int): Int { return operation(a, b) } // 函数的使...
Jetpack Compose-Stewed Noodles 资源

Jetpack Compose

Jetpack compose 是谷歌开发的一款现代工具包,用于构建原生 Android用户界面。它允许开发者使用声明式编程模型为 Android应用构建 UI 界面,当底层数据发生改变时,Compose 负责更新 UI 界面,...