问题描述
我是第一次使用 Storyboards 构建应用程序.我有一个场景,当长按特定按钮时,我想打开另一个场景.我可以毫无问题地添加 UILongPressGestureRecognizer
,但我不知道如何让该手势成为另一个场景的转场.Ctrl-Drag 似乎无关紧要,没有任何效果.
I am building an app for the first time using Storyboards. I have a scene which I would like to have open another scene when there is a long tap on a particular button. I am able to add the UILongPressGestureRecognizer
with no problem, but I can't figure out how to have that gesture be the segue to the other scene. Doesn't seem to matter what I Ctrl-Drag, nothing works.
我是否遗漏了一些明显的东西?
Am I missing something obvious?
谢谢,肯
推荐答案
您可以从第一个控制器的窗口控制拖动到第二个控制器以创建转场,然后您可以调用 performSegueWithIdentifier
您的 GestureRecognizer
方法.
You can control-drag from your first controller's window to your second controller to create the segue, and then you can call performSegueWithIdentifier
in your GestureRecognizer
method.
这篇关于如何向 UIGestureRecognizer 添加转场的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!