[英]How do I create two custom segues, one for each direction?
I was able to look up a way to transition between two ViewControllers using a UIScrollView that I can use as a transition between two VCs. 我能够找到一种使用UIScrollView在两个ViewController之间进行转换的方法 , 该方法可以用作两个VC之间的转换。
I have an issue however, I have a TableView with cells that trigger a different kind of segue when tapped. 但是,我有一个问题,我有一个TableView,其中的单元格在点击时会触发另一种顺序。 (The Segue is some labels move to the new VC and other stuff appears)
(Segue是一些标签移至新的VC,并且出现了其他内容)
I then want to be able to swipe back and forth all while the first animation is controlled by how much I swiped between. 然后,我希望能够在第一个动画由我之间的滑动量控制的同时来回滑动。 For example.
例如。 if the user swipes just a small bit I want the animations to reverse back, so that if he changes his mind, he can still stay on his current VC.
如果用户仅轻扫一点,我希望动画向后退,以便他改变主意,仍可以继续使用当前的VC。 But if he wants to go back to the old VC, the labels animate back in place.
但是,如果他想回到旧的VC,标签会恢复原状。
Basically like Snapchat but only one to go back, and the labels revert back. 基本上像Snapchat,但只有一个可以回溯,而标签会还原。 The other way is by tapping.
另一种方法是通过点击。
Here is a video mockup of the animation, please excuse its crudeness 这是动画的视频模型,请原谅
You need to read up on transition controllers. 您需要阅读过渡控制器。 What you want to do is to create a custom transition controller, specifically a
UIPercentDrivenInteractiveTransition
. 您想要做的是创建一个自定义过渡控制器,尤其是
UIPercentDrivenInteractiveTransition
。 Take a look at this tutorial on the subject: 看一下有关此主题的本教程:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.