Skip to content

Commit

Permalink
Add transition view corner radius
Browse files Browse the repository at this point in the history
  • Loading branch information
kinarobin committed Mar 18, 2019
1 parent aa084f0 commit 459961b
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions RLImageBrowser/RLTransitionManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ - (void)animateTransition:(id <UIViewControllerContextTransitioning>)transitionC
UIView *fromView = fromController.view;
UIView *toView = toController.view;

// present
/** present */
if (toController.isBeingPresented) {
self->_isEnter = YES;
self.isTransitioning = YES;
Expand All @@ -90,7 +90,7 @@ - (void)animateTransition:(id <UIViewControllerContextTransitioning>)transitionC
return;
}

// dismiss
/** dismiss */
if (fromController.isBeingDismissed) {
self->_isEnter = NO;
self.isTransitioning = YES;
Expand All @@ -104,10 +104,14 @@ - (void)animateTransition:(id <UIViewControllerContextTransitioning>)transitionC
fadeView.alpha = fadeAlpha;
[RLNormalWindow() addSubview:fadeView];

UIImage *animatedImage = transitionView ? [transitionView transitionAnimatedImageView].image : scrollView.photoImageView.image;
UIImageView *transitionImageView = [transitionView transitionAnimatedImageView];
UIImage *animatedImage = transitionView ? transitionImageView.image : scrollView.photoImageView.image;
CGRect imageViewFrame = [self animationFrameForImage:animatedImage presenting:NO scrollView:scrollView];
self.animateImageView.frame = imageViewFrame;
self.animateImageView.image = animatedImage;
self.animateImageView.clipsToBounds = transitionImageView ? transitionView.clipsToBounds : scrollView.photoImageView.clipsToBounds;
self.animateImageView.layer.cornerRadius = transitionImageView ? transitionImageView.layer.cornerRadius : scrollView.photoImageView.layer.cornerRadius;

[RLNormalWindow() addSubview:self.animateImageView];

fromView.hidden = YES;
Expand Down

0 comments on commit 459961b

Please sign in to comment.