From 83d646455bc09a64fee83c60eb6e8d166be93aac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=83=A1=E4=BA=91=E9=B9=8F?= Date: Thu, 15 Oct 2020 17:28:00 +0800 Subject: [PATCH] fix Keyboard Hides when sidemenu appears but after closing side menu keyboard appears again --- Pod/Classes/SideMenuNavigationController.swift | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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) {