This is because you most likely add as a presentation
[transitionContext viewControllerForKey:UITransitionContextFromViewControllerKey]
and submitted
[transitionContext viewControllerForKey:UITransitionContextToViewControllerKey]
map the controllers in your View container to the (void) animateTransition: (id) transitionContext method of your animation controller. Since you are using a special modal presentation, the presenting view controller is still displayed below the presented view controller . Now, since it is still visible, you do not need to add it to the container view. Instead, add only the presented view controller to the container. It should look something like this inside your animateTransition: method
UIView *containerView = [transitionContext containerView]; UIViewController *fromViewController = [transitionContext viewControllerForKey:UITransitionContextFromViewControllerKey]; UIViewController *toViewController = [transitionContext viewControllerForKey:UITransitionContextToViewControllerKey]; // Boolean value to determine presentation or dismissal animation if (self.presenting){ [transitionContext.containerView addSubview:toViewController.view]; // Your presenting animation code } else { // Your dismissal animation code }
DJSK Sep 26 '14 at 0:42 2014-09-26 00:42
source share