I have a very weird problem, in a typical animated transition code like below, after do the transition a few time then the view becomes irresponsive. I dug a little bit and found that the navigationController:animationControllerForOperation:fromViewController:toViewController:
method is not called, even the pushViewController:animated:
method is called. Any ideas?
This VC transits to another VC, then that VC can transit back with an interactive animated transition. The same problem happens in the other view as well, i.e., the transition is initiated but navigationController:animationControllerForOperation:fromViewController:toViewController:
is not called. This only happens after I played with the app for like half a minute.
.h file
@interface ViewController : UIViewController <UINavigationControllerDelegate>
@end
.m file
@implementation ViewController
- (void)viewDidAppear:(BOOL)animated
{
[self.navigationController setDelegate:self];
}
- (void) transit_to_next_view
{
//...
UIViewController* newvc;
[self.navigationController pushViewController:newvc animated:YES];
}
// animated transition
- (id<UIViewControllerAnimatedTransitioning>)navigationController:(UINavigationController *)navigationController animationControllerForOperation:(UINavigationControllerOperation)operation fromViewController:(UIViewController *)fromVC toViewController:(UIViewController *)toVC
{
// return animator
}
@end