macgeezer macgeezer - 27 days ago 19
iOS Question

How do I add a segue to an UIGestureRecognizer

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?

Thanks,
Ken

Answer

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.

Comments