title: CATransition showing a single frame from the end of the transition before the animation starts
body: <p>I am using some code which was originally taken from the Apple sample ViewTransitions to swap two views with each other.</p>
  
  <pre><code>CATransition *animation = [CATransition animation];
  [animation setDelegate:self];
  [animation setType:kCATransitionFade];
  [animation setDuration:0.3f];
  [animation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear]];
  [[container layer] addAnimation:animation forKey:@"swap"];
  </code></pre>
  
  <p>When my transition executes on the devlice, I sometimes get a single frame flash of the final frame of the transition animation and then the animation plays smoothly. This gives a very jarring effect of the 2nd view which flickers in and then out again before the smooth animation executes.</p>
  
  <p>The main difference between my example and the Apple example is that my views are not full screen, I have a container UIView which contains both sub-views and I am applying my animation to the container layer instead the root view layer. I can not see that this should make much difference though.</p>
  
  <p>This issue does not happen at all in the simulator and is intermittent (about 60-70% of the time) on the device. Is anyone else seeing this behaviour and if so, how did you work around it?</p>
  
  <p><strong>Updated with more information:</strong>
  The code was originally part of a multi part animation but I moved it to be triggered by a button to isolate the problem. The issue occurs in both situations.</p>
  
  <p>The animation delegates were implemented but have been removed to try and isolate the problem.</p>
  
  <p>The views are not changing during the animation and in fact <code>[container setUserInteractionEnabled:NO]</code> is being called (but the problem also happens without user interaction being disabled).</p>
  
  <p>I have tried starting the animation from the middle of the transition and ending before the end using <code>setStartProgress</code> and <code>setEndProgress</code>, again the problem persists.</p>
  
  <p>I have tried slowing the animation duration right down as well with no effect.</p>