UIViewControllerAnimatedTransitioning in iOS7 - viewWillAppear not called

I am trying to get the new viewController animations to hang in ios7, but when I try to use basic animations, I run into a road bump.

Im finding that after the transition is complete, the "view" controller does not seem to get the typical view lifecycle methods, that is, viewWillAppear and viewDidAppear . I call fullTransition: but that seems to be enough - is this typical behavior? Or am I doing something wrong? here is my code:

 -(void)executeDismissalAnimation:(id<UIViewControllerContextTransitioning>)transitionContext{ UIView *inView = [transitionContext containerView]; UIViewController *toViewController = [transitionContext viewControllerForKey:UITransitionContextToViewControllerKey]; UIViewController *fromViewController = [transitionContext viewControllerForKey:UITransitionContextFromViewControllerKey]; toViewController.view.hidden = NO; [CATransaction begin]; [CATransaction setCompletionBlock:^{ [fromViewController.view removeFromSuperview]; [transitionContext completeTransition:YES]; }]; CGFloat duration = 0.4f; CAKeyframeAnimation *scaleAnimation = [CAKeyframeAnimation animationWithKeyPath:@"transform.scale"]; scaleAnimation.values = [self floatValuesFromValue:1.f toValue:1.5f withEasingFunction:ExponentialEaseInOut]; scaleAnimation.duration = duration; scaleAnimation.fillMode = kCAFillModeForwards; scaleAnimation.removedOnCompletion = YES; [fromViewController.view.layer addAnimation:scaleAnimation forKey:nil]; CAKeyframeAnimation *alphaAnimation = [CAKeyframeAnimation animationWithKeyPath:@"opacity"]; alphaAnimation.values = [self floatValuesFromValue:1.f toValue:0.f withEasingFunction:LinearInterpolation]; alphaAnimation.duration = duration*2; alphaAnimation.fillMode = kCAFillModeForwards; alphaAnimation.removedOnCompletion = YES; [fromViewController.view.layer addAnimation:alphaAnimation forKey:nil]; CAKeyframeAnimation *scaleAnimationB = [CAKeyframeAnimation animationWithKeyPath:@"transform.scale"]; scaleAnimationB.values = [self floatValuesFromValue:0.6f toValue:1.0f withEasingFunction:ExponentialEaseInOut]; scaleAnimationB.duration = duration; scaleAnimationB.beginTime = CACurrentMediaTime()+0.3; scaleAnimationB.fillMode = kCAFillModeForwards; scaleAnimationB.removedOnCompletion = NO; [toViewController.view.layer addAnimation:scaleAnimationB forKey:nil]; CAKeyframeAnimation *alphaAnimationB = [CAKeyframeAnimation animationWithKeyPath:@"opacity"]; alphaAnimationB.values = [self floatValuesFromValue:0.5f toValue:1.f withEasingFunction:LinearInterpolation]; alphaAnimationB.duration = duration; alphaAnimationB.beginTime = CACurrentMediaTime()+0.3; alphaAnimationB.fillMode = kCAFillModeForwards; alphaAnimationB.removedOnCompletion = NO; [toViewController.view.layer addAnimation:alphaAnimationB forKey:nil]; [CATransaction commit]; } 
+6
source share

All Articles