diff --git a/lib/ios/InteractivePopGestureDelegate.h b/lib/ios/InteractivePopGestureDelegate.h index db010bb4fb3..75db0369c2a 100644 --- a/lib/ios/InteractivePopGestureDelegate.h +++ b/lib/ios/InteractivePopGestureDelegate.h @@ -1,14 +1,3 @@ -// -// InteractivePopGestureDelegate.h -// ReactNativeNavigation -// -// Created by Arman Dezfuli-Arjomandi on 1/10/19. -// Copyright © 2019 Wix. All rights reserved. -// -// - -// This file is adapted from the following StackOverflow answer: -// https://stackoverflow.com/questions/24710258/no-swipe-back-when-hiding-navigation-bar-in-uinavigationcontroller/41895151#41895151 #import diff --git a/lib/ios/InteractivePopGestureDelegate.m b/lib/ios/InteractivePopGestureDelegate.m index fd837633198..52954152bc6 100644 --- a/lib/ios/InteractivePopGestureDelegate.m +++ b/lib/ios/InteractivePopGestureDelegate.m @@ -1,17 +1,12 @@ -// -// InteractivePopGestureDelegate.m -// ReactNativeNavigation -// -// Created by Arman Dezfuli-Arjomandi on 1/10/19. -// Copyright © 2019 Wix. All rights reserved. -// #import "InteractivePopGestureDelegate.h" @implementation InteractivePopGestureDelegate - (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch { - if (self.navigationController.navigationBarHidden && self.navigationController.viewControllers.count > 1) { + if (self.navigationController.viewControllers.count < 2) { + return NO; + } else if (self.navigationController.navigationBarHidden) { return YES; } else if (!self.navigationController.navigationBarHidden && self.originalDelegate == nil) { return YES; @@ -28,8 +23,4 @@ - (BOOL)respondsToSelector:(SEL)aSelector { } } -- (id)forwardingTargetForSelector:(SEL)aSelector { - return self.originalDelegate; -} - @end