我这里有两种情况。1.从VC1单击按钮,我想移动到VC6,然后向后滑动。这是通过上面提到的代码完成的。2. 我在 VC1 中也有滑动手势移动到 VC2、VC3、VC4、VC5 和 VC6。现在我想从 VC6 滑动回 VC5、Vc4、VC3、VC2 然后到 VC1。我可以分别实现这两个场景。但是我怎样才能一起实现这些场景。
我有六个视图控制器。在viewController1
我有一个按钮,可以将我带到viewController6
. 然后我从使用代码中分别弹回viewController5
, viewController4
, viewController3
,viewController2
和viewController1
viewController6
- (IBAction)SwipeGoto5:(UISwipeGestureRecognizer *)sender
{
IndexPage *P1VC=[[IndexPage alloc] initWithNibName:@"IndexPage" bundle:nil];
Page2 *P2VC=[[Page2 alloc] initWithNibName:@"Page2" bundle:nil];
Page3 *P3VC=[[Page3 alloc] initWithNibName:@"Page3" bundle:nil];
Page4 *P4VC=[[Page4 alloc] initWithNibName:@"Page4" bundle:nil];
Page5 *P5VC=[[Page5 alloc] initWithNibName:@"Page5" bundle:nil];
NSLog(@"swipe to 5");
NSMutableArray *allViewControllers = [NSMutableArray arrayWithArray: self.navigationController.viewControllers];
[allViewControllers insertObject:P1VC atIndex:1];
[allViewControllers insertObject:P2VC atIndex:2];
[allViewControllers insertObject:P3VC atIndex:3];
[allViewControllers insertObject:P4VC atIndex:4];
[allViewControllers insertObject:P5VC atIndex:5];
self.navigationController.viewControllers=allViewControllers;
[self.navigationController popViewControllerAnimated:YES];
}
我也有UISwipeGestureRecognizer
带viewController1
我去viewController2
,viewController3
和. 当我使用on并且我也有上面提到的代码时,我将如何弹出。viewController4
viewController6
viewController6
UISwipeGestureRecognizer
viewController1