Skip to content

Commit

Permalink
Fix popGesture freezes the app, Closes wix#4388 (wix#5009)
Browse files Browse the repository at this point in the history
  • Loading branch information
yogevbd authored and vshkl committed Feb 5, 2020
1 parent af1acfc commit dbc61f6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 23 deletions.
11 changes: 0 additions & 11 deletions lib/ios/InteractivePopGestureDelegate.h
Original file line number Diff line number Diff line change
@@ -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 <UIKit/UIKit.h>

Expand Down
15 changes: 3 additions & 12 deletions lib/ios/InteractivePopGestureDelegate.m
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -28,8 +23,4 @@ - (BOOL)respondsToSelector:(SEL)aSelector {
}
}

- (id)forwardingTargetForSelector:(SEL)aSelector {
return self.originalDelegate;
}

@end

0 comments on commit dbc61f6

Please sign in to comment.