Skip to content

Commit

Permalink
Adds tint color into consideration when animating
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasdelgado authored and michaelhenry committed Mar 18, 2022
1 parent 9d9cb94 commit b7b8416
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,13 @@ extension ImageViewerTransitionPresentationAnimator: UIViewControllerAnimatedTra

transitionView.addSubview(controller.view)
transitionVC.targetView?.alpha = 0.0
transitionVC.targetView?.tintColor = sourceView.tintColor

let dummyImageView = createDummyImageView(
frame: sourceView.frameRelativeToWindow(),
image: sourceView.image)
dummyImageView.contentMode = .scaleAspectFit
dummyImageView.tintColor = sourceView.tintColor
transitionView.addSubview(dummyImageView)

UIView.animate(withDuration: duration, animations: {
Expand Down Expand Up @@ -121,6 +123,7 @@ extension ImageViewerTransitionPresentationAnimator: UIViewControllerAnimatedTra
let dummyImageView = createDummyImageView(
frame: targetView?.frameRelativeToWindow() ?? UIScreen.main.bounds,
image: targetView?.image)
dummyImageView.tintColor = sourceView?.tintColor
transitionView.addSubview(dummyImageView)
targetView?.isHidden = true

Expand Down

0 comments on commit b7b8416

Please sign in to comment.