Dismiss modalviewcontroller with a page curl
In iOS4:
To present, it's something like:
[containerView addSubview:modelView];[UIView transitionWithView:containerView duration:.75 UIViewAnimationOptionTransitionCurlUp animations:^{} completion:^(BOOL finished) { NSLog(@"finished %d", finished); }];
To dismiss, use UIViewAnimationOptionTransitionCurlDown
.
Your setAnimationTransition: shouldn't be forView:modelView; it should be for the parentView.
[UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:containerView cache:NO];
If you want to change the appearance of a view during a transition—for example, flip from one view to another—then use a container view, an instance of UIView, as follows:
- Begin an animation block.
- Set the transition on the container view.
- Remove the subview from the container view.
- Add the new subview to the container view.
- Commit the animation block.
Use of this method is discouraged in iOS 4.0 and later. You should use the block-based animation methods instead.