From d127e7ea74dcd896df62ce1d582baf9c91cfea65 Mon Sep 17 00:00:00 2001 From: Kyle Hickinson Date: Mon, 22 Mar 2021 13:11:36 -0400 Subject: [PATCH] Remove appearance transitions called on presenting controller MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This better mimics how iOS handles `overFullScreen`/`overCurrentContext`/`pageSheet` style presentations where—since the presenting view controller is remaining visible and part of the view hierarchy—it does not call `view*Appear`/`view*Disappear` methods --- PanModal/Animator/PanModalPresentationAnimator.swift | 8 -------- 1 file changed, 8 deletions(-) diff --git a/PanModal/Animator/PanModalPresentationAnimator.swift b/PanModal/Animator/PanModalPresentationAnimator.swift index f7fbdd0e..4c31f0f6 100644 --- a/PanModal/Animator/PanModalPresentationAnimator.swift +++ b/PanModal/Animator/PanModalPresentationAnimator.swift @@ -71,9 +71,6 @@ public class PanModalPresentationAnimator: NSObject { let presentable = panModalLayoutType(from: transitionContext) - // Calls viewWillAppear and viewWillDisappear - fromVC.beginAppearanceTransition(false, animated: true) - // Presents the view in shortForm position, initially let yPos: CGFloat = presentable?.shortFormYPos ?? 0.0 @@ -93,7 +90,6 @@ public class PanModalPresentationAnimator: NSObject { panView.frame.origin.y = yPos }, config: presentable) { [weak self] didComplete in // Calls viewDidAppear and viewDidDisappear - fromVC.endAppearanceTransition() transitionContext.completeTransition(didComplete) self?.feedbackGenerator = nil } @@ -108,9 +104,6 @@ public class PanModalPresentationAnimator: NSObject { let toVC = transitionContext.viewController(forKey: .to), let fromVC = transitionContext.viewController(forKey: .from) else { return } - - // Calls viewWillAppear and viewWillDisappear - toVC.beginAppearanceTransition(true, animated: true) let presentable = panModalLayoutType(from: transitionContext) let panView: UIView = transitionContext.containerView.panContainerView ?? fromVC.view @@ -120,7 +113,6 @@ public class PanModalPresentationAnimator: NSObject { }, config: presentable) { didComplete in fromVC.view.removeFromSuperview() // Calls viewDidAppear and viewDidDisappear - toVC.endAppearanceTransition() transitionContext.completeTransition(didComplete) } }