Browse Source

[iOS] Fix disabledBackGesture. (#1281)

* Fix disabledBackGesture.

This `return self._disableBackGesture ? self._disableBackGesture : YES;` check is incorrect, it's the same as `true ? true : true;`.
Also `_disableBackGesture` was never set. We should just `return disabledBackGestureBool` (bool value of the prop).

* [iOS] Enable back swipe gesture when a navBar is hidden. Resolves this issue: https://github.com/wix/react-native-navigation/issues/930

added 03d380f8a9 back and also applied this fix https://github.com/wix/react-native-navigation/issues/428#issuecomment-278268928 on top of it

* Revert accidental commit: 3cdb1b37f6
Grundmanis 7 years ago
parent
commit
94d01386a6
1 changed files with 3 additions and 2 deletions
  1. 3
    2
      ios/RCCViewController.m

+ 3
- 2
ios/RCCViewController.m View File

@@ -24,7 +24,6 @@ const NSInteger TRANSPARENT_NAVBAR_TAG = 78264803;
24 24
 @property (nonatomic) BOOL _statusBarHideWithNavBar;
25 25
 @property (nonatomic) BOOL _statusBarHidden;
26 26
 @property (nonatomic) BOOL _statusBarTextColorSchemeLight;
27
-@property (nonatomic) BOOL _disableBackGesture;
28 27
 @property (nonatomic, strong) NSDictionary *originalNavBarImages;
29 28
 @property (nonatomic, strong) UIImageView *navBarHairlineImageView;
30 29
 @end
@@ -658,7 +657,9 @@ const NSInteger TRANSPARENT_NAVBAR_TAG = 78264803;
658 657
 
659 658
 #pragma mark - UIGestureRecognizerDelegate
660 659
 -(BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer {
661
-  return self._disableBackGesture ? self._disableBackGesture : YES;
660
+  NSNumber *disabledBackGesture = self.navigatorStyle[@"disabledBackGesture"];
661
+  BOOL disabledBackGestureBool = disabledBackGesture ? [disabledBackGesture boolValue] : NO;
662
+  return !disabledBackGestureBool;
662 663
 }
663 664
 
664 665