在 iOS 中,如何区分 Haptic Touch 和长按?

In iOS, how can I distinguish a Haptic Touch from a long press?

Apple 最近的 iPhone XR 公告用 Haptic Touch 取代了 3D Touch,让您只需长按视图即可访问 3D Touch 功能。

我很好奇它将如何与现有 UILongPressGestureRecognizer 界面交互。我的应用程序中的某些项目目前具有不同的 3D Touch 和长按功能。

由于 iPhone XR 硬件尚不可用,我想知道是否已发布任何关于这两个功能如何协同工作的信息。

"In 2015, when the iPhone 6S and 6S Plus were announced, Apple also introduced 3D Touch. 3D Touch uses a Taptic Engine with haptic feedback, which allows the device to sense the pressure of a touch, thereby triggering specific actions. For example, pressing hard on an icon will enable us to quickly open an action menu." - Clayton, C.(2018 年 1 月)。 Learn iOS 11 Programming with Swift 4 - Second Edition.

“3D Touch 基本上是一种技术,它为您在每个 iOS 设备中找到的点击机制添加了另一个维度(因此得名)。传统上,用户可以在 iOS 设备的屏幕用她的手指:

  • 点击;
  • 长按;
  • 滑动;
  • 双击。

随着设备上 3D Touch 的可用性,一个记录屏幕触摸强度的新矢量被添加到公式中,允许用户将手指保持在屏幕上并施加更大的压力,直到执行操作(指定的应用程序)。 3D Touch 仅允许 iOS 设备访问用户在屏幕上按压手指的力度,这为一组全新的应用程序打开了大门。”- Nahavandipoor, V.(2017 年)。 iOS 11 Swift Programming Cookbook.

“3D Touch 之所以有效,是因为 iPhone 的屏幕对压力敏感。您可以在显示屏上按压,按压得越用力,“发生的情况”就越多。 Haptic Touch 屏幕,例如 iPhone XR,没有这种压力敏感度。相反,Haptic Touch 似乎只是我们的老朋友长按的新名称。 (...) 似乎 Haptic Touch 可以完成 3D Touch 已经完成的大部分工作。在 iOS 12 中,添加了一种新的触控板模式,适用于每个 iPhone 和 iPad。触控板模式可让您用力按压将 iPhone 的键盘变成触控板,进而让您控制上面文本中的光标。新模式可让您通过长按键盘的 space 栏来执行相同操作。我几乎可以肯定,此功能将在 iPhone XR 中获得触觉触摸振动。”- Sorrel,C.(2018 年 9 月)。What’s the difference between 3-D Touch and Haptic Touch?

"It’s important to remember that not all devices have a Taptic Engine; in the devices that don’t, the feedback simply won’t be played. This means that you mustn’t rely on tactile feedback (...) it should be used to underline effects that are already visually or aurally present." - Buttfield-Addison, P., Manning, J.(2018 年 10 月)。 iOS Swift Game Development Cookbook, 3rd Edition.

"Considering they removed 3D Touch from the device to cut manufacturing costs and to give us the new "Liquid Retina”显示屏,我们不希望任何真正的压力敏感度与 Haptic Touch 相关联。” - Peterson, J.(2018 年 9 月)。 All the 3D Touch Actions You'll Lose by Switching to the iPhone XR with 'Haptic Touch'.

现阶段尚不清楚 Apple 和第三方应用在 3D Touch 上支持的功能有多少 and/or 将在 Haptic Touch 上得到支持。

有了这个,3D 触摸现在发生的事情似乎与 2015 年 Force touch 发生的事情相似。触觉触摸的含义更具体地描述了一组可能的操作(因为 3D 触摸具有更广泛的含义) .正如 Buttfield-Addison, P. 和 Manning, J. 所提到的,我不会依赖这种类型的反馈。由于您已经在您的应用程序中使用了它,并且基于触觉的含义(与触觉有关,特别是与使用触觉和本体感觉来感知和操纵物体有关),我认为长按会保持不变,因为它是正常/主流人行为集中可能的触摸交互之一。

有一篇good answer in apple.stackexchange推荐你看看

根据使用 Hardware | Touch Pressure | Use Trackpad Force 选项在模拟器中进行的测试,Haptic Touch 只是长按。