gpt4 book ai didi

iOS 触觉触摸 API 的可能性

转载 作者:行者123 更新时间:2023-11-29 11:27:04 24 4
gpt4 key购买 nike

由于我们在 iOS 13 中失去了 3D Touch API,例如 UIViewControllerPreviewingUIContextMenuInteraction 似乎是替代品。

如果您想在 Haptic Touch 上放置菜单,UIContextMenuInteraction 非常适合。如果您想在识别 Haptic Touch 时做其他事情怎么办?

有这样的事吗?或者 Haptic Touch 是否与 UILongPressGesture 相同?

最佳答案

阅读文档 UIContextMenuInteraction 继承自 UIInteraction。搜索所有子类:

  • UIContextMenuInteraction
  • UIDragInteraction
  • UIDropInteraction
  • UILargeContentViewerInteraction
  • UIPencilInteraction
  • UISpringLoadedInteraction
  • UITextInteraction

回顾每个子类,我认为最适合替换 UIViewControllerPreviewing 的是 UILargeContentViewerInteraction,因为 UILargeContentViewerInteractionDelegate 有一个返回 View Controller 的方法。

UIViewControllerPreviewing

UIContextMenuInteraction

UIInteraction

UILargeContentViewerInteractionDelegate

关于iOS 触觉触摸 API 的可能性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57697352/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com