This prevents default animation.
- (void)viewWillDisappear:(BOOL)animated {
[UIView setAnimationsEnabled: NO];
}
- (void)viewDidDisappear:(BOOL)animated {
[UIView setAnimationsEnabled: YES];
}
In case if you need a custom animation
- (void)viewWillDisappear:(BOOL)animated {
[UIView setAnimationsEnabled: NO];
CATransition *transition = [CATransition animation];
transition.duration = 0.3;
transition.type = kCATransitionFade;
[self.navigationController.view.layer addAnimation:transition forKey:kCATransition];
}
- (void)viewDidDisappear:(BOOL)animated {
[UIView setAnimationsEnabled: YES];
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…