2 年前,我使用 Swift 中的 3D 触控功能制作了一款游戏,因为它非常新,但我从未发布过这款游戏,因为我得到了一份新合同。现在我有时间想发布它,但代码不再起作用。(3D 触摸自定义动作,而不是 peek & pop 动作)
当我打印触摸结果时,力值将始终返回 0.0,如下所示:
[<UITouch: 0x102613850> phase: Began tap count: 2 force: 0.000 window: <UIWindow: 0x10222bf70; frame = (0 0; 414 896); gestureRecognizers = <NSArray: 0x28011cde0>; layer = <UIWindowLayer: 0x280f41840>> view: <UIView: 0x102083080; frame = (0 82; 414 780); autoresize = RM+BM; gestureRecognizers = <NSArray: 0x2801a0c30>; layer = <CALayer: 0x280f2a540>> location in window: {299.33332824707031, 661.66665649414062} previous location in window: {299.33332824707031, 661.66665649414062} location in view: {299.33332824707031, 579.66665649414062} previous location in view: {299.33332824707031, 579.66665649414062}]
我知道 Apple 出于成本原因正在从设备中删除此功能,但我记得,iPhone 11 pro 仍然有它。有谁知道这个值是否被弃用?