From f8a986906229abab51c9c64942ea83341d3a5ed7 Mon Sep 17 00:00:00 2001 From: edwardmp Date: Fri, 1 Jun 2018 16:19:40 +0200 Subject: [PATCH] Fix delegate methods not called when pan cancelled I noticed that leftWillClose/rightWillClose delegate methods are not called when the pan is cancelled, while in reality they should. These changes address this issue. --- Source/SlideMenuController.swift | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Source/SlideMenuController.swift b/Source/SlideMenuController.swift index 08bc88c..013c82b 100644 --- a/Source/SlideMenuController.swift +++ b/Source/SlideMenuController.swift @@ -421,6 +421,7 @@ open class SlideMenuController: UIViewController, UIGestureRecognizerDelegate { closeLeftWithVelocity(panInfo.velocity) setCloseWindowLevel() + self.delegate?.leftWillClose?() track(.leftFlickClose) } @@ -503,6 +504,7 @@ open class SlideMenuController: UIViewController, UIGestureRecognizerDelegate { closeRightWithVelocity(panInfo.velocity) setCloseWindowLevel() + self.delegate?.rightWillClose?() track(.rightFlickClose) } case UIGestureRecognizerState.failed, UIGestureRecognizerState.possible: