[英]How do I add a segue to an UIGestureRecognizer
I am building an app for the first time using Storyboards. 我是第一次使用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. 我可以
UILongPressGestureRecognizer
地添加UILongPressGestureRecognizer
,但我不知道如何使该手势成为其他场景的主题。 Doesn't seem to matter what I Ctrl-Drag, nothing works. Ctrl + Drag似乎无关紧要,但没有任何效果。
Am I missing something obvious? 我是否缺少明显的东西?
Thanks, Ken 谢谢,肯
您可以控制从第一个控制器的窗口拖动到第二个控制器以创建segue,然后可以在GestureRecognizer
方法中调用performSegueWithIdentifier
。
It's now possible to do it all in your Storyboard visually. 现在可以在故事板上直观地完成所有操作。 Every gesture recognizer has Triggered Segues in Connections Inspector.
每个手势识别器在Connections Inspector中都有Triggered Segues。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.