My application has a navigation controller and I don't want any animation in it :
to prevent an animation when pushing a view, it's easy, via the pushViewController:animated: method
but when I click the "back" button on this subview, there's an animation ! KO ! What can I do to prevent this animation ?
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];
}