Skip to content

Commit

Permalink
Remove appearance transitions called on presenting controller
Browse files Browse the repository at this point in the history
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
  • Loading branch information
kylehickinson committed Mar 22, 2021
1 parent b2f5bd7 commit d127e7e
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions PanModal/Animator/PanModalPresentationAnimator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
}
Expand All @@ -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
Expand All @@ -120,7 +113,6 @@ public class PanModalPresentationAnimator: NSObject {
}, config: presentable) { didComplete in
fromVC.view.removeFromSuperview()
// Calls viewDidAppear and viewDidDisappear
toVC.endAppearanceTransition()
transitionContext.completeTransition(didComplete)
}
}
Expand Down

0 comments on commit d127e7e

Please sign in to comment.