title: CATransition working wrong on orientation change before dismissing a NavigationViewController
body: <p>Here is my code used to present a navigationViewController :</p>
  
  <pre><code>-(IBAction)showFilterView:(id)sender {
  
      FilterViewController *vc=[self.storyboard instantiateViewControllerWithIdentifier:@"FilterViewController"];
      UINavigationController *nvc=[[UINavigationController alloc] initWithRootViewController:vc];
  
  
      CATransition *transition = [CATransition animation];
      transition.duration = 0.35;
      transition.timingFunction =
      [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
      transition.type = kCATransitionMoveIn;
      transition.subtype = kCATransitionFromLeft;
  
      UIView *containerView = self.view.window;
      [containerView.layer addAnimation:transition forKey:nil];
      [self.tabBarController presentViewController:nvc animated:NO completion:nil];
  
  }
  </code></pre>
  
  <p>And here is my code to dismiss</p>
  
  <pre><code>-(IBAction)back:(id)sender {
  
  
      CATransition *transition = [CATransition animation];
      transition.duration = 0.35;
      transition.timingFunction =
      [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
      transition.type = kCATransitionMoveIn;
      transition.subtype = kCATransitionFromRight;
      UIView *containerView = self.view.window;
      [containerView.layer addAnimation:transition forKey:nil];
      [[self.navigationController presentingViewController] dismissViewControllerAnimated:NO completion:nil];
  }
  </code></pre>
  
  <p>Situation 1 --- Working well in landscape mode</p>
  
  <p>Situation 2 --- Working well in portrait mode</p>
  
  <p>Situation 3 --- Presenting in a portrait mode and dismissing in landscape mode not working properly(extra animation before displaying correct view)</p>
  
  <p>Situation 4 ---Presenting in a landscape mode and dismissing in portrait mode not working properly(extra animation before displaying correct view)</p>