双击Segue移到下一个

双击Segue移到下一个

本文介绍了双击Segue移到下一个情节提要的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在制作一个应用程序,用户必须双击该脚本才能移至下一个故事板,但是我找不到任何可以告诉您如何执行此操作的地方。有人知道我怎么能做到这一点吗?

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?

推荐答案

如果在Story Builder中使用Storyboard实现此功能:

If you do this in Interface Builder with a storyboard:


  1. 从对象库中将点击手势识别器拖到视图中。

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

请确保拖动的视图

选择添加到场景中的轻击手势(可以在Interface Builder主面板左侧的文档轮廓中找到该手势;此文档大纲可以在您看不到的地方折叠起来...如果看不到,请从编辑菜单中选择显示文档大纲。

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).

将抽头数从1更改为2。

Change the number of taps from 1 to 2.

-从文档大纲中的点击手势拖动到下一个场景,然后选择所需的segue类型。

-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.

这篇关于双击Segue移到下一个情节提要的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-30 12:07