问题
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
回答1:
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.
回答2:
It's now possible to do it all in your Storyboard visually. Every gesture recognizer has Triggered Segues in Connections Inspector.
来源:https://stackoverflow.com/questions/11888891/how-do-i-add-a-segue-to-an-uigesturerecognizer