Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 13 additions & 24 deletions Pod/Classes/RMPZoomTransitionAnimator.m
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ - (RMPZoomTransitionAnimator * _Nonnull)initWithAnimationDurationForward:(NSTime
instead of repeatability having to use the convenience init method.
*/
- (void)setDefaultAnimationDuration {
kForwardAnimationDuration = 0.3;
kForwardAnimationDuration = 0.45;
kForwardCompleteAnimationDuration = 0.2;
kBackwardAnimationDuration = 0.25;
kBackwardCompleteAnimationDuration = 0.18;
kBackwardAnimationDuration = 0.45;
kBackwardCompleteAnimationDuration = 0;
}

#pragma mark - <UIViewControllerAnimatedTransitioning>
Expand Down Expand Up @@ -150,27 +150,16 @@ - (void)animateTransition:(id<UIViewControllerContextTransitioning>)transitionCo
alphaView.alpha = 0;
}
completion:^(BOOL finished) {
[UIView animateWithDuration:kBackwardCompleteAnimationDuration
delay:0
options:UIViewAnimationOptionCurveEaseOut
animations:^{
sourceImageView.alpha = 0;
}
completion:^(BOOL finished) {
if ([self.destinationTransition conformsToProtocol:@protocol(RMPZoomTransitionAnimating)] &&
[self.destinationTransition respondsToSelector:@selector(zoomTransitionAnimator:didCompleteTransition:animatingSourceImageView:)]) {
[self.destinationTransition zoomTransitionAnimator:self
didCompleteTransition:![transitionContext transitionWasCancelled]
animatingSourceImageView:sourceImageView];
}
[transitionContext completeTransition:![transitionContext transitionWasCancelled]];
if(![[UIApplication sharedApplication].keyWindow.subviews containsObject:toVC.view]) {
[[UIApplication sharedApplication].keyWindow addSubview:toVC.view];
}
// Remove the views from superviews to release the references
[alphaView removeFromSuperview];
[sourceImageView removeFromSuperview];
}];
if ([self.destinationTransition conformsToProtocol:@protocol(RMPZoomTransitionAnimating)] &&
[self.destinationTransition respondsToSelector:@selector(zoomTransitionAnimator:didCompleteTransition:animatingSourceImageView:)]) {
[self.destinationTransition zoomTransitionAnimator:self
didCompleteTransition:![transitionContext transitionWasCancelled]
animatingSourceImageView:sourceImageView];
}
[transitionContext completeTransition:![transitionContext transitionWasCancelled]];
// Remove the views from superviews to release the references
[alphaView removeFromSuperview];
[sourceImageView removeFromSuperview];
}];
}
}
Expand Down