Objective-C 如何像 Twitter 一样显示预览

How to show preview like in Twitter in Objective-C

我正在 Objective-C 中处理 UIViewControllerPreviewing,Peek 和 pop 工作正常,但我需要像下图这样的 Twitter 3D Touch,我的意思是当我们使用 3D Touch 时我需要选项。

但是使用 UIViewControllerPreviewing,我无法实现。

我认为您需要这个 UIContextMenuInteraction - 使用 UIContextMenuInteraction 对象将用户的注意力集中在内容的特定部分,并为用户提供对该内容执行的操作。上下文菜单交互对象在支持 3D Touch 的设备上跟踪 Force Touch 手势,在不支持它的设备上跟踪长按手势。

希望对您有所帮助!