“handLandmarkKeyWrist”在 iOS 14.0 中已被弃用

问题描述

我的项目正在使用视觉框架。随着 iOS 14.0 更新,大部分视觉类型 handLandmarkRegion 已重命名。我按照建议固定了拇指、食指、中指、小指和无名指的点。然而,当我试图修复手腕时,它给出了一个错误。这是当前的折旧代码

            guard let wristPoint = wristPoints[.handLandmarkKeyWrist] else {
                self.state = "no wrist"
                return
            }

当我尝试将第一行修复为

guard let wristPoint = wristPoints[VNHumanHandPoSEObservation.JointName.wrist]

我收到此错误

Subscript 'subscript(_:)' requires that 'VNHumanHandPoSEObservation.JointName' conform to 'RangeExpression'

如果我删除 wristPoints[],那么我得到 Initializer for conditional binding must have Optional type,not 'VNHumanHandPoSEObservation.JointName'

我尝试了一些其他组合,但它们也不起作用。如何使用最新的协议进行确认?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)