我目前有一个应用程序与3视图
- 屏幕1 -使用'show' segue跳转到屏幕2
- 屏幕2 -使用'modal' segue跳转到屏幕3
- 屏幕3
我在屏幕1中有一个unwind segue从屏幕2和屏幕3中调用这个unwind segue
当前,当我从Screen 3调用Screen 1的unwind segue时,它会动画为一个正在关闭的模态视图
是否有可能有这个unwind segue动画一个标准的"弹出"segue,比如当屏幕弹出正常的导航堆栈?
我能够通过为模态视图创建不同的segue来完成我想要的。我的界面有一些额外的东西我不想解释,但屏幕3现在取代了屏幕2,没有模态segue。然后当我在屏幕3上调用unwind segue时,它会使用来自屏幕1的push segue unwind。
这是我在屏幕2和屏幕3之间使用的自定义segue
-(void)perform {
UIViewController *sourceViewController = (UIViewController*)[self sourceViewController];
UIViewController *destinationController = (UIViewController*)[self destinationViewController];
UINavigationController *navigationController = sourceViewController.navigationController;
// Pop to root view controller (not animated) before pushing
[navigationController popToRootViewControllerAnimated:NO];
[navigationController pushViewController:destinationController animated:NO];
}