setViewControllers的应用

1—>2–->3  然后3pop/左滑动的时候直接到1
 
在2中 点击事件中 重置self.navigationController的controllers..
  [self.view whenTapped:^{
        NSMutableArray *aM = [NSMutableArray arrayWithArray:self.navigationController.viewControllers];
        [aM removeObject:a.lastObject];  
        UIViewController *v3 =[[ViewController3 alloc]init];
        [aM addObject:v3];
        [self.navigationController setViewControllers:aM animated:YES];  //重置完后只有1,3即使左滑动也是1
}];

posted on 2017-05-23 16:00  崔付亮  阅读(264)  评论(0编辑  收藏  举报