3个viewcontroller: A, B, C
[A presentViewController: B animated: YES]
[B presentViewController: C animated: YES]
在C中如何直接返回到A,当前我得做法:
[c.presentingViewController.presentingViewController dismissViewControllerAnimated:YES completion:nil];
模拟器上测试,可以直接返回到A,但还是能够看到C返回到B, B再返回到A,只不过B停留在屏幕的时间非常的短。
我尝试过, [c.presentingViewController.presentingViewController dismissViewControllerAnimated:NO completion:nil];
会有闪的突兀感。觉得不好。
有什么方法,可以避免出现以上这种情况,使用户感觉不到B曾经出现过,同时也不会让用户感觉到屏幕顿闪的突兀感?
presentingViewController连续嵌套不会觉得很奇怪?
我都是用navigation然后push,回到第一个只需要用self.navigationController popToRootViewControllerAnimated:
或者试试[[[[[self parentViewController] parentViewController] parentViewController] parentViewController] dismissModalViewControllerAnimated:YES];