title: Animate Color Navigation Bar when ScrollView Down
body: <p>in my <code>View Controller</code> I have a collectionView with 3 cells and horizontal scrolling ..</p>
  
  <p>In each cell I have a <code>TableView</code></p>
  
  <p>I have a problem with animation to change the color of the navigation bar in the <code>view controller</code>.</p>
  
  <p>To manage the method <code>- (void) scrollViewDidScroll: (UIScrollView *) scrollView</code> I created a delegate that manages the color change of the navigation bar ..</p>
  
  <p>My problem is that I can't animate the navigation bar's alpha color using as a reference <code>scrollView.contentOffset.y</code> ... The color changes immediately but is not animated based on the scrollView's contentOffset.</p>
  
  <p>can anyone help me figure out where i'm wrong?</p>
  
  <p><strong>TableView inside a CollectionView cell</strong></p>
  
  <pre><code>-(void)scrollViewDidScroll:(UIScrollView *)scrollView {
      [self.delegate cellScrollDownWithOffset:scrollView.contentOffset.y];
  }
  </code></pre>
  
  <p><strong>View Controller with collectionView received delegate</strong></p>
  
  <pre><code>#pragma mark - BaseVerticalCell delegate
  
  -(void)cellScrollDownWithOffset:(CGFloat)offset {
  
      [UIView animateWithDuration:.3 animations:^{
  
      UIColor *opacheColor = [UIColor colorWithHexString:@"#F9F9FA" setAlpha:offset /150];
      UIColor *defaultColor = [UIColor colorWithWhite:1 alpha:offset /150];
  
      self.navigationController.navigationBar.barTintColor = offset/ 150 &gt; 0 ? opacheColor : defaultColor;
      }];
  }
  </code></pre>