跟进这个问题
假设我的应用程序有几个ViewControllers
,我们称它们为 A、B、C、D。通常后退一步,即从 D -> C,将使用行中的NavigationBar
或通过代码中的后退按钮
[self.navigationController popViewControllerAnimated:YES];
我想要做的是后退几步,比如从 D -> B。这将通过
[self.navigationController popToViewController:B animated:YES];
不幸的是,这样我无法决定使用哪个动画。我必须使用翻转动画而不是默认动画。
我发现的唯一方法是这种方法
[self.navigationController transitionFromViewController:self.navigationController.presentedViewController toViewController:B duration:300 options:UIViewAnimationOptionTransitionFlipFromRight animations:nil completion:nil];
这是实现这一目标的唯一方法还是有人可以提出更好的方法来做到这一点?