最新发布第24页
排序
Fragment
基本介绍 Fragment 代表应用程序 UI 可复用的部分。Fragment 定义和管理自己的布局,拥有自己的生命周期,并且可以处理自己的输入事件。Fragment 不能独自存在,它们必须由一个 Activity 或者另...
it 关键字
当 Lambda 表达式或匿名函数只接收 一个参数 时,it 会作为这个参数的 隐式名称(默认参数名)。 val numbers = listOf(1, 2, 3, 4, 5) // it 表示参数 println(numbers.map { it * it }) // [1...
Property Delegation
在 Kotlin 中,属性代理(Property Delegation)允许将一个属性 getter 和 setter 的实现委托给另一个对象(委托的对象)。 这项特性的标志就是关键字 by,它被用在 属性定义 与 委托(代理)对...
NavHostController
基本介绍 NavHostController 是 Jetpack Compose Navigation 中负责管理导航状态的核心控制器。 记录当前在哪个页面(destination) 处理导航动作(navigate / popBackStack) 管理返回栈(Back...
Hilt 框架
Hilt 是 Google 官方推荐的 Android 依赖注入(DI)框架,基于 Dagger,极大简化了配置和使用成本,减少样板代码,与 ViewModel / Activity / Fragment / Service 深度集成,可以自动管理依赖生...
模型配置
ModelConfiguration 是SwiftData 中用于确定数据存储方式和位置的组件。它指定了使用哪个 CloudKit 容器(如果有的话),以及是否启用保存功能。这些配置提供给模型容器,以决定其行为。通过合...
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...
What’s the difference between async let, tasks, and task groups? async let、tasks 和 task groups 之间有什么区别?
Swift’s async let, Task, and task groups all solve a similar problem: they allow us to create concurrency in our code so the system is able to run them efficiently. Beyo...







