Browse Source

New Feature: adding disabledSimultaneousGesture flag to manage simultaneous gesture recognition (#1777)

Thanh Le 7 years ago
parent
commit
6a2af3ecc0
3 changed files with 7 additions and 0 deletions
  1. 1
    0
      docs/styling-the-navigator.md
  2. 1
    0
      ios/RCCNavigationController.m
  3. 5
    0
      ios/RCCViewController.m

+ 1
- 0
docs/styling-the-navigator.md View File

78
   statusBarHidden: false, // make the status bar hidden regardless of nav bar state
78
   statusBarHidden: false, // make the status bar hidden regardless of nav bar state
79
   
79
   
80
   disabledBackGesture: false, // default: false. Disable the back gesture (swipe gesture) in order to pop the top screen. 
80
   disabledBackGesture: false, // default: false. Disable the back gesture (swipe gesture) in order to pop the top screen. 
81
+  disabledSimultaneousGesture: true, // default: true. Disable simultaneous gesture recognition.
81
   screenBackgroundImageName: '<name of image in Images.xcassets>', // Optional. default screen background image.
82
   screenBackgroundImageName: '<name of image in Images.xcassets>', // Optional. default screen background image.
82
   rootBackgroundImageName: '<name of image in Images.xcassets>', // Static while you transition between screens. Works best with screenBackgroundColor: 'transparent'
83
   rootBackgroundImageName: '<name of image in Images.xcassets>', // Static while you transition between screens. Works best with screenBackgroundColor: 'transparent'
83
 
84
 

+ 1
- 0
ios/RCCNavigationController.m View File

105
         [mergedStyle removeObjectForKey:@"autoAdjustScrollViewInsets"];
105
         [mergedStyle removeObjectForKey:@"autoAdjustScrollViewInsets"];
106
         [mergedStyle removeObjectForKey:@"statusBarTextColorSchemeSingleScreen"];
106
         [mergedStyle removeObjectForKey:@"statusBarTextColorSchemeSingleScreen"];
107
         [mergedStyle removeObjectForKey:@"disabledBackGesture"];
107
         [mergedStyle removeObjectForKey:@"disabledBackGesture"];
108
+        [mergedStyle removeObjectForKey:@"disabledSimultaneousGesture"];
108
         [mergedStyle removeObjectForKey:@"navBarCustomView"];
109
         [mergedStyle removeObjectForKey:@"navBarCustomView"];
109
         [mergedStyle removeObjectForKey:@"navBarComponentAlignment"];
110
         [mergedStyle removeObjectForKey:@"navBarComponentAlignment"];
110
         
111
         

+ 5
- 0
ios/RCCViewController.m View File

783
   return !disabledBackGestureBool;
783
   return !disabledBackGestureBool;
784
 }
784
 }
785
 
785
 
786
+-(BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer{
787
+  NSNumber *disabledSimultaneousGesture = self.navigatorStyle[@"disabledSimultaneousGesture"];
788
+  BOOL disabledSimultaneousGestureBool = disabledSimultaneousGesture ? [disabledSimultaneousGesture boolValue] : YES; // make default value of disabledSimultaneousGesture is true
789
+  return !disabledSimultaneousGestureBool;
790
+}
786
 
791
 
787
 @end
792
 @end