I'm attempting to animate the navigation bar when performing a custom segue. The navigation bar is controlled by a Navigation Controller. The following code allows the embedded view to fade and zoom into view, though the navigation bar remains unanimated. How the changes in navigation bar be animated?
#import "MDAZoomSegue.h"
@implementation MDAZoomSegue
- (void)perform {
UIViewController *sourceViewController = (UIViewController *) self.sourceViewController;
UIViewController *destinationViewController = (UIViewController *) self.destinationViewController;
[sourceViewController.view addSubview:destinationViewController.view];
[destinationViewController.view setFrame:sourceViewController.view.window.frame];
[destinationViewController.view setTransform:CGAffineTransformMakeScale(1.2,1.2)];
[destinationViewController.view setAlpha:0];
[UIView animateWithDuration:0.5
delay:0.0
options:UIViewAnimationCurveEaseOut
animations:^{
[destinationViewController.view setTransform:CGAffineTransformMakeScale(1.0,1.0)];
[destinationViewController.view setAlpha:1.0];
}
completion:^(BOOL finished){
[destinationViewController.view removeFromSuperview];
[sourceViewController.navigationController pushViewController:destinationViewController animated:NO];
}];
}
@end