title: Animate barTintColor on push segue
body: <p>I would like to animate <code>barTintColor</code> property when <strong>transitioning from one <code>view controller</code> to another</strong>.</p>
  
  <p>I have tried with following solution:</p>
  
  <pre><code>[[self transitionCoordinator] animateAlongsideTransition:^(id&lt;UIViewControllerTransitionCoordinatorContext&gt; context) {
      self.navigationController.navigationBar.translucent = NO;
      self.navigationController.navigationBar.barTintColor = [UIColor redColor];
  } completion:nil];
  </code></pre>
  
  <p>which animates <code>barTintColor</code> as it should but my <strong>navigation bar</strong> should be translucent. To fix this problem I tried to set it to <code>translucent = YES</code> in completion block of <code>trasitionCoordinator</code>animation. Like this:</p>
  
  <pre><code>completion:^(id&lt;UIViewControllerTransitionCoordinatorContext&gt; context) {
      self.navigationController.navigationBar.translucent = YES;
  }
  </code></pre>
  
  <p>but that causes slight jump in <code>barTintColor</code> value of <strong>navigation bar</strong> after the animation is completed. This is expected since translucent and opaque colors are different.</p>
  
  <p>Similar questions:
  <a href="https://stackoverflow.com/questions/19272698/ios-7-uinavigationcontroller-navbar-per-controller-color-animation">[1]</a>
  <a href="https://stackoverflow.com/questions/21593760/animate-a-uinavigationbars-bartintcolor">[2]</a></p>
  
  <p>Thanks in advance!</p>
  
  <p><strong>EDIT</strong>:</p>
  
  <p>I forgot to add that some strange scale animation appears from top left corner in <strong>navigation bar</strong> if I remove the <code>self.navigationController.navigationBar.translucent = NO;</code> line from animation block. So that's not the solution either.</p>