From 2805de8b143c5e0b72007d9410ff340fcec02817 Mon Sep 17 00:00:00 2001 From: Ortwin Gentz Date: Tue, 14 Oct 2014 21:30:26 +0200 Subject: [PATCH] Support opaque backgroundColors --- AMWaveTransition/AMWaveTransition.m | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/AMWaveTransition/AMWaveTransition.m b/AMWaveTransition/AMWaveTransition.m index cef36ad..3a5b1e1 100644 --- a/AMWaveTransition/AMWaveTransition.m +++ b/AMWaveTransition/AMWaveTransition.m @@ -211,6 +211,7 @@ - (void)handlePan:(UIScreenEdgePanGestureRecognizer *)gesture [self setPresentedFrameForView:view]; }]; } completion:^(BOOL finished) { + toVC.view.backgroundColor = fromVC.view.backgroundColor; [toViews enumerateObjectsUsingBlock:^(UIView *view, NSUInteger idx, BOOL *stop) { [self animationCompletionForInteractiveTransitionForView:view]; }]; @@ -387,6 +388,10 @@ - (void)animateTransition:(id )transitionC // And kick it aside toVC.view.transform = CGAffineTransformMakeTranslation(delta, 0); + [transitionContext containerView].backgroundColor = fromVC.view.backgroundColor; + fromVC.view.backgroundColor = UIColor.clearColor; + toVC.view.backgroundColor = UIColor.clearColor; + // First step is required to trigger the load of the visible cells. [UIView animateWithDuration:0 delay:0 options:UIViewAnimationOptionCurveEaseIn animations:nil completion:^(BOOL finished) { @@ -396,6 +401,8 @@ - (void)animateTransition:(id )transitionC [UIView animateWithDuration:self.duration + self.maxDelay delay:0 options:UIViewAnimationOptionCurveEaseIn animations:^{ [toVC.view setTransform:CGAffineTransformIdentity]; } completion:^(BOOL finished2) { + toVC.view.backgroundColor = [transitionContext containerView].backgroundColor; + [transitionContext containerView].backgroundColor = UIColor.clearColor; [transitionContext completeTransition:YES]; }]; } else { @@ -406,6 +413,8 @@ - (void)animateTransition:(id )transitionC } completion:^(BOOL finished2) { [fromVC.view removeFromSuperview]; [transitionContext completeTransition:YES]; + toVC.view.backgroundColor = [transitionContext containerView].backgroundColor; + [transitionContext containerView].backgroundColor = UIColor.clearColor; }]; }