Double Tap Segue to move to next storyboard

2019-07-20 18:44发布

问题:

I am making an app where the user has to double tap a segue to move to the next storyboard, but I cannot find anywhere where it tells you how to do this. Does anyone know how I can achieve this?

回答1:

If you do this in Interface Builder with a storyboard:

  1. Drag a tap gesture recognizer from the object library onto your view.

  2. Make sure the view you dragged it to has "user interaction enabled" checked.

  3. Select the tap gesture you added to your scene (which you can find in your document outline on the left side of Interface Builder's main panel; this document outline can be collapsed where you can't see it ... if you don't see it, select "Show Document Outline" from the "Edit" menu).

  4. Change the number of taps from 1 to 2.

  5. control-drag from the tap gesture in the document outline to the next scene and choose your type of segue you want.

Frequently, people will create their gesture recognizers in code, so if you're interested in how that works, let me know.



回答2:

Users do not interact with Segues and Storyboards in an app. Segues and Storyboards are tools that Apple provides within Xcode to aid in developing iOS apps.

If what you're asking is how to move to a new UIViewController once the user has double tapped a control (such as a UIButton), refer to this answer.