tags:

views:

208

answers:

1

I am looking for a way to present a modal view animated, and make it look like the current modal view is presenting the new one in the animation, but behind the scenes ditch the old modal view (the new modal should have the same parent as the old one).

Presenting one on top of the other is not an option as there is an arbitrary number of views. This isn't a hierarchy, think of it like flash cards.

Thanks for any help.

A: 

You probably don't want to use view controllers for this, but UIView animation blocks. Take a look at +[UIView beginAnimations:context:] in the UIView docs.

Ben Gottlieb
I'm vaguely familiar with beginAnimations:context: but I'm not making the connection as to how I would cause something to flip over using this. I thought that was only available as a view transition?
Alex Gosselin
New code based on this:[UIView beginAnimations:@"FlipAndGetNew" context:nil];[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:self.firstSubview cache:NO];[firstSubview removeFromSuperview];[UIView commitAnimations];Unfortunately the view just disappears rather than animating out... still missing something.
Alex Gosselin
You will need to do the removeFromSuperview in the completion routine for the animation. Not inside the animation block.
St3fan