title: iPhone SDK: Flip-and-scale animation between view controllers using blocks?
body: <p>I'm trying to create a flip-and-scale animation between two view controllers. This seems possible using animation blocks available in iOS 4.0, but I'm still unsure how to implement it. I found <a href="https://stackoverflow.com/questions/3103298/how-can-i-avoid-a-leak-with-this-block-based-animation-sequence">this</a> SO question which shows a flip animation.</p>
  
  <p>Using this code, flipping between two views works fine, but scaling doesn't -- the flip animation completes and then the new view jumps to the correct size. How would I flip the view and scale it at the same time?</p>
  
  <pre><code>UIView *tempContainer = myView.contentView ;
  [UIView transitionWithView:tempContainer
                    duration:2
                     options:UIViewAnimationOptionTransitionFlipFromRight
                  animations:^{ 
                      [[[tempContainer subviews] objectAtIndex:0] removeFromSuperview]; 
                      [tempContainer addSubview:myOtherViewController.view];
                      CGAffineTransform transform = CGAffineTransformMakeScale(4.0, 4.0);
                      tempContainer.transform = transform;
                  } 
                  completion:^(BOOL finished){
                      [tempContainer release]; 
                  }];
  </code></pre>