为交互式popviewcontroller guest

时间:2017-07-03 09:07:59

标签: ios swift uiviewcontroller uigesturerecognizer unwind-segue

对于初学者 - 我使用Swift 3和Xcode 8。

我熟悉可能性,怎么做"放松segue"来自StoryBoards或以编程方式(例如,在UIButton上单击)。 但是我很感兴趣,是否有可能使用" unwind segue" for"交互式popviewcontroller"手势语?

通过"交互式popviewcontroller" guest - 我的意思是通过从左侧向右滑动屏幕来解除/弹出当前推送的UIViewController的选项。

1 个答案:

答案 0 :(得分:1)

问题的解决方案实际上非常简单,因为您似乎熟悉如何连接按钮并在命名时使用它们“展开segues”或解除视图控制器等等。您可以做的是获取滑动来自对象库的手势识别器。

/Users/deyanaleksandrov/Desktop/Screen Shot 2017-07-03 at 12.12.49 PM.png

或屏幕边缘手势识别器(适用于您)。

enter image description here

在故事板中将该识别器添加到VC并将其连接起来,就像连接UIButton一样。 另请注意,在属性检查器中,您可以使用属性并设置滑动的方向,所需的触摸次数等。

enter image description here enter image description here

查看下面的图片以查看要处理的其他实现:

enter image description here

enter image description here

enter image description here

我希望这会有所帮助: - )

相关问题