diff --git a/Pod/Classes/SideMenuNavigationController.swift b/Pod/Classes/SideMenuNavigationController.swift index d88bb8b6..fa99e0ad 100644 --- a/Pod/Classes/SideMenuNavigationController.swift +++ b/Pod/Classes/SideMenuNavigationController.swift @@ -504,6 +504,13 @@ internal extension SideMenuNavigationController { transitionController?.interactive = interactively dismiss(animated: flag, completion: completion) } + + func dismissMenuWithTap() { + guard !isHidden else { return } + transitionController?.interactive = true + dismiss(animated: true, completion: nil) + transitionController?.handle(state: .finish) + } // Note: although this method is syntactically reversed it allows the interactive property to scoped privately func present(from viewController: UIViewController?, interactively: Bool, completion: (() -> Void)? = nil) { @@ -635,7 +642,7 @@ private extension SideMenuNavigationController { @objc func handleDismissMenuTap(_ tap: UITapGestureRecognizer) { let hitTest = view.window?.hitTest(tap.location(in: view.superview), with: nil) guard hitTest == view.superview else { return } - dismissMenu() + dismissMenuWithTap() } @objc func handleDismissMenuPan(_ gesture: UIPanGestureRecognizer) {