From 4c2f5f98310b64943a37ef0fbdee1f43d9736658 Mon Sep 17 00:00:00 2001 From: Frank <472730949@qq.com> Date: Fri, 21 Oct 2016 21:41:20 +0800 Subject: [PATCH] fix swipe back function when force touch is enabled. --- SwipeBack/UIViewController+SwipeBack.m | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/SwipeBack/UIViewController+SwipeBack.m b/SwipeBack/UIViewController+SwipeBack.m index b44098c..e38f4ca 100644 --- a/SwipeBack/UIViewController+SwipeBack.m +++ b/SwipeBack/UIViewController+SwipeBack.m @@ -48,7 +48,11 @@ + (void)swizzle:(SEL)selector - (void)swizzled_viewDidAppear:(BOOL)animated { [self swizzled_viewDidAppear:animated]; - self.navigationController.interactivePopGestureRecognizer.enabled = YES; + + // fix swipe back function when 3D-touch is enabled. + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ + self.navigationController.interactivePopGestureRecognizer.enabled = YES; + }); } @end