Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix popGesture freezes the app, Closes #4388 #5009

Merged
merged 4 commits into from
Apr 21, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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