Code:
UIView *superView = [self.view superview];
CATransition *animation = [CATransition animation];
animation.duration = 0.5f;
animation.timingFunction = UIViewAnimationCurveEaseInOut;
animation.fillMode = kCAFillModeForwards;
animation.type = kCATransitionFade;
animation.subtype = kCATransitionFromTop;
[root.view removeFromSuperview];
[self.view removeFromSuperview];
[superView.layer addAnimation:animation forKey:@"removeContentAnimation"];
self.view and root.view were added in “superView”
When I committed this animation, there was a little chance to occur a error – Both of the views was removed from the superView and came back immediately. After this quick change, it disappeared normally.
check out this doku: http://developer.apple.com/library/ios/#documentation/WindowsViews/Conceptual/ViewPG_iPhoneOS/AnimatingViews/AnimatingViews.html#//apple_ref/doc/uid/TP40009503-CH6-SW1
and here is a short hint: