SwiftUI ScrollView 合集 reader.scrollTo SwiftUI, How to scroll to the top? Swiftui Scrollview scroll to bottom of list SwiftUI automatically scroll to bottom in ScrollView (Bottom first) SwiftUI ScrollView通过代码滚动 滚动位置 Get th 2025-01-07 合集 #SwiftUI
IMU 精度问题 动态情况下,所有纯惯导在地下几乎做不到 1cm 定位精度,谈不上保精度导航时长; 1cm 左右的检测任务,大概率需要以相机或激光反射仪等高精度测量为输入,结合深度学习算法来做,如果是移动机器人或小车,可能还需要 SLAM 技术 具体分析如下: 纯惯导:如果是军用,纯惯导(Inertial Navigation System, INS)精度一般是米或海里这种级别,短时工作的可以到分米级别,很少 2025-01-07 随笔 #IMU
「转载」Swift Equatable & Hashable 通用协议 原文:Swift 自定义结构体和类应该遵循的通用协议 Equatable & Hashable使用自定义类型对程序中的数据进行建模时,可能经常需要检查两个值是否相同或不同,或者值列表中是否包含特定值。 此功能以及将值存储在集合中或用作字典中的键的功能受两个相关的标准库协议Equatable和Hashable约束。 你可以使用等于(==)和非等于(!=)运算符比 2024-12-20 转载 #SwiftUI
SwiftUI Equatable 与 Hashable 协议 当我们用实例作为 tag 时,可能会出现这样的报错: 1Instance method 'tag' requires that 'Class' conform to 'Hashable' 当我们对结构体使用 onChang() 的时候,可能会出现这样的报错: 1Referencing instance method 'onCh 2024-12-19 合集 #SwiftUI
macOS 删除所选 List row 双击 List row 删除123456789101112List(selection: $selection) { ForEach(items, id: \.self) { item in Text(item) .contextMenu { Button(action: { 2024-12-19 随笔 #SwiftUI
App Icon 生成 在 iOS 上,现在已经不用各种尺寸 App Icon 了,只需要一张 1024x1024 的 App Icon 图片即可。 参考:從 Xcode 設定 iOS App Icon 但是在 macOS 上的 App 还是需要 11 个不同尺寸的 App Icon。下面网站,只需要提供一张 1024x1024 的 App Icon 就能生成其它尺寸的 App Icon。 App icon Gener 2024-12-19 随笔 #生产力
Swift 求正六边形网格中颜色相同且相邻的正六边形数量 如图所示,蓝色正六边形族的数量应该是 4 和 2。 下面介绍 Swift 代码的实现办法。 首先为正六边形进行编号,如图: 再为每个正六边形关联相邻的六边形,例如 1 - 2, 3, 4 2 - 1, 4, 6 关联好之后,以 1 号六边形为例: 将 1 号加入 check 数组 -> [1] 遍历 check 数组,将 1 号加入 blue 数组 -> [1];将 1 号加 2024-12-12 随笔 #Swift
Xcode 提示 Modifications to the layout engine must not be performed from a background thread after it has been accessed from the main thread. 提示 Modifications to the layout engine must not be performed from a background thread after it has been accessed from the main thread.,翻译过来大概是「不能在后台线程中改变布局,必须在主线程中才能进行布局操作」。 报错出现的代码是在 URLSession.shared 2024-12-12 随笔 #Swift #Xcode
Swift 在地图上绘制正六边形 正六边形的结构1234567struct Hexagon:{ let points: [CLLocationCoordinate2D] let centerLatitude: Double let centerLongitude: Double let startAngle: Double let radius: Double } 正六边形 2024-12-11 随笔 #Map #Swift