UINavigationController缺少方法 !(可选的完成块的push / pop)。实现使用UINavigationController委托。
此项目提供:
[self.navigationController popViewControllerAnimated:YES withCompletionBlock:NULL];
[self.navigationController popViewControllerAnimated:YES withCompletionBlock:NULL];
[self.navigationController popViewControllerAnimated:YES withCompletionBlock:NULL];
- (void)pushViewController:(UIViewController *)viewController
animated:(BOOL)animated
withCompletionBlock:(JMONavCompletionBlock)completionBlock;
- (void)popViewControllerAnimated:(BOOL)animated
withCompletionBlock:(JMONavCompletionBlock)completionBlock;
- (void)popToRootViewControllerAnimated:(BOOL)animated
withCompletionBlock:(JMONavCompletionBlock)completionBlock;
- (void)activateCompletionBlock;
并使用弹出/推送方法
[self.navigationController popViewControllerAnimated:YES withCompletionBlock:NULL];
[self.navigationController pushViewController:vc animated:YES withCompletionBlock:^(BOOL successful) {
NSLog(@"Hi ! Push done !");
}];
[self.navigationController popViewControllerAnimated:YES withCompletionBlock:NULL];
[self.navigationController pushViewController:vc animated:YES withCompletionBlock:^(BOOL successful) {
NSLog(@"Hi ! Push done !");
}];