title: iPhone page curl transition animation
body: <p>I'm trying to instigate a page curl transition with a <code>UIImageView</code> in a Window. This code is in my main init method :</p>
  
  <pre><code>[UIView beginAnimations:nil context:nil];
  [UIView setAnimationDuration:1.5];
  [UIView setAnimationDelay:delay];
  [UIView setAnimationBeginsFromCurrentState:YES];
  [UIView setAnimationDidStopSelector:@selector(animCompleteHandler:finished:context:)];
  [UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:splashImage cache:YES];
  
  splashImage.frame = CGRectMake(-320, 0, 10, 10);
  //[splashImage removeFromSuperview];
  
  [UIView commitAnimations];
  </code></pre>
  
  <p>The image animates position and size but no curl. If I uncomment the <code>removeFromSuperView</code> it just vanishes instantly. Any ideas?</p>
  
  <p>UPDATE:</p>
  
  <p>Have changed the code so it uses Lars fantasticlly neat way of triggering an animation and including the animation and callback ...</p>
  
  <pre><code>[UIView animateWithDuration:1.5
                        delay:delay
                      options: UIViewAnimationTransitionCurlUp 
                   animations:^{splashImage.alpha = 0;}
                   completion:^(BOOL finished){[splashImage removeFromSuperview];}
   ];
  </code></pre>
  
  <p>Unfortunately the page curl just doesn't happen. It does fade though.</p>
  
  <p>I'm not sure if this is something to do with the syntax or the fact that the <code>SplashImage</code> is a <code>UIImageView</code> class in the <code>UIWindow</code> object of my main view. Maybe it needs to be in a <code>UIView</code> to create the transition.</p>