简体   繁体   English

如何创建两个自定义序列,每个方向一个?

[英]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: 看一下有关此主题的本教程:

custom UIViewController Transitions 自定义UIViewController过渡

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在视图控制器中为单个按钮创建两个序列? - How can I create two segues for a single button in a view controller? 如何使用两个自定义 UITableViewCell 在一个视图控制器中创建两个表视图? - How do I create two table views in one view controller with two custom UITableViewCells? 如何创建一个自定义的“水平翻转”push segue就像用于模态segue的那样? - How to create a custom “flip horizontally” push segue like the one that's used for modal segues? 如何根据objective-c中的滚动方向创建一个从UINavBar后面向下或向上滑动的自定义UIView? - How do I create a custom UIView that slides down or up from behind a UINavBar depending on scroll direction in objective-c? 如何创建一个按钮,但使其具有两个功能? - How do I create one button, but make it have two functions? 如何清理Storyboard Segues创建的UIViewController实例? - How do I clean up UIViewController instances created by Storyboard Segues? 如何在iOS 7上使用带有通用故事板的popover segues? - How do I use popover segues with a universal storyboard on iOS 7? 如何在故事板细分之间传递信息? - How do I pass information between storyboard segues? 如何加速 iOS 转换和转场? - How do I speed up iOS transitions and segues? 如何在iOS 5上的segues之间的Storyboard UIViewController上设置属性? - How do I set a property on a Storyboard UIViewController between segues on iOS 5?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM