diff --git a/Framework/Sources/FloatingPanelTransitioning.swift b/Framework/Sources/FloatingPanelTransitioning.swift index 6af8c99..a6ef907 100644 --- a/Framework/Sources/FloatingPanelTransitioning.swift +++ b/Framework/Sources/FloatingPanelTransitioning.swift @@ -59,6 +59,8 @@ class FloatingPanelPresentationController: UIPresentationController { fpView.bottomAnchor.constraint(equalTo: containerView.bottomAnchor, constant: 0.0), ]) + (fpView as? FloatingPanelPassThroughView)?.eventForwardingView = presentingViewController.view + let tapGesture = UITapGestureRecognizer(target: self, action: #selector(handleBackdrop(tapGesture:))) fpc.backdropView.addGestureRecognizer(tapGesture) } diff --git a/Framework/Sources/FloatingPanelView.swift b/Framework/Sources/FloatingPanelView.swift index e29cd9a..39e599a 100644 --- a/Framework/Sources/FloatingPanelView.swift +++ b/Framework/Sources/FloatingPanelView.swift @@ -6,13 +6,14 @@ import UIKit class FloatingPanelPassThroughView: UIView { + public weak var eventForwardingView: UIView? public override func hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView? { - let view = super.hitTest(point, with: event) - switch view { - case is FloatingPanelPassThroughView: - return nil + let hitView = super.hitTest(point, with: event) + switch hitView { + case self: + return eventForwardingView?.hitTest(self.convert(point, to: eventForwardingView), with: event) default: - return view + return hitView } } }