title: Animation of alpha on UIView not working
body: <p>I'm making a custom segue that fades to black, swaps out the view controller and then fades back to transparent.  Unfortunately, I can't seem to get it to do that.  Here's the code:</p>
  
  <pre><code>- (void)perform {
  
      UIView *overlay = [[UIView alloc] initWithFrame:CGRectMake(0, 0, [self.sourceViewController navigationController].view.frame.size.width, [self.sourceViewController navigationController].view.frame.size.height)];
      [overlay setBackgroundColor:[UIColor colorWithRed:0 green:0 blue:0 alpha:0.0]];
      [[self.sourceViewController navigationController].view addSubview:overlay];
  
      [UIView animateWithDuration:2.0 delay:0.0 options:(UIViewAnimationOptionCurveEaseIn) animations:^{
        [overlay setAlpha:1.0];
      }completion:^(BOOL finished) {
        [[self.sourceViewController navigationController] pushViewController:[self destinationViewController] animated:NO];
        [UIView animateWithDuration:2.0 delay:0.0 options:(UIViewAnimationOptionCurveEaseIn) animations:^{
          [overlay setAlpha:0.0];
        }completion:^(BOOL finished) {
          [overlay removeFromSuperview];
          NSLog(@"Done!");
        }];
      }];
  
  }
  </code></pre>
  
  <p>So, what I've done is add a UIView to the navigation controller that has a black background and an alpha of 0.  Then, I do an animation to change the alpha to 1, push the destination view controller onto the navigation controller, and then animate back to clear.  When I do this, nothing happens.  It just drops the destination view controller onto the navigation controller without any kind of animation.  </p>
  
  <p>Oddly, if I start with an alpha of 1 and animate to 0 and then back to 1, it works (but it isn't what I want). </p>
  
  <p>I'm thinking that there's some optimization happening that excludes my clear UIView and so changing the transparency is meaningless. </p>