最新发布第22页
排序
Day 17 – 自定义类(Class)
自定义类 类定义的语法,如下 # 类的定义, ClassName必须首字母大写 class ClassName: # 类的对象 class_name_1 = ClassName() 常见的几种命名方式- PascalCase - camelCase - snake_case 构造...
查询数据
SwiftData 提供了 @Query 宏,用于从 SwiftUI 视图中查询模型对象,并可选择提供排序顺序、过滤谓词,以及用于平滑处理结果变化的自定义动画或自定义事务。更棒的是,@Query 会在每次数据变化时...
Animation
当指定的值发生变化时,将给定的动画应用于此视图。 struct ContentView: View { @State private var scale = 0.5 var body: some View { VStack { Circle().scale(scale).animation(.easeIn, v...
Transaction
当前状态处理更新的上下文。 transaction(value:_:) 使用.transaction 修饰符来更改或替换视图中使用的动画。考虑一个由按钮控制的三个相同视图,同时改变所有三个的情况: 第一个视图通过旋转...
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 make async command-line tools and scripts 如何制作异步命令行工具和脚本
If you’re writing a command-line tool with Swift, you can use async code in two ways: if you're using main.swift you can immediately make and use async functions as norm...
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...
How to force concurrent tests to run on a specific actor 如何强制并发测试在特定actor上运行
Swift Testing and XCTest behave differently when it comes to running tests in parallel: unless you say otherwise, Swift Testing will run both synchronous and asynchronous tests on ...
普通报销单表头
普通报销单表头添加经费来源,最终的效果如下图所示 普通报销单表头添加经费来源 录入页面 当选择经费来源字段时,表头后添加 [经费来源值]。 打开 webmain/flow/input/inputjs/mode_putong.js ...
Kotlin 函数
函数的声明 // 函数声明 fun functionName(parameter1: Type, parameter2: Type): ReturnType { // 函数体 // 执行逻辑 // (可选)返回值 } 无参无返回值 无参无返回值的函数,如下所示 // 无...





