|
@@ -8,7 +8,7 @@
|
8
|
8
|
|
9
|
9
|
const NSInteger kLightBoxTag = 0x101010;
|
10
|
10
|
|
11
|
|
-@interface RCCLightBoxView : UIView
|
|
11
|
+@interface RCCLightBoxView : UIView<UIGestureRecognizerDelegate>
|
12
|
12
|
@property (nonatomic, strong) RCTRootView *reactView;
|
13
|
13
|
@property (nonatomic, strong) UIVisualEffectView *visualEffectView;
|
14
|
14
|
@property (nonatomic, strong) UIView *overlayColorView;
|
|
@@ -51,14 +51,15 @@ const NSInteger kLightBoxTag = 0x101010;
|
51
|
51
|
self.overlayColorView.backgroundColor = backgroundColor;
|
52
|
52
|
self.overlayColorView.alpha = 0;
|
53
|
53
|
[self addSubview:self.overlayColorView];
|
54
|
|
-
|
55
|
|
- if (style[@"tapBackgroundToDismiss"] != nil && [RCTConvert BOOL:style[@"tapBackgroundToDismiss"]])
|
56
|
|
- {
|
57
|
|
- UITapGestureRecognizer *singleTap=[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(dismissAnimated)];
|
58
|
|
- [self.overlayColorView addGestureRecognizer:singleTap];
|
59
|
|
- }
|
60
|
54
|
}
|
61
|
55
|
}
|
|
56
|
+
|
|
57
|
+ if (style[@"tapBackgroundToDismiss"] != nil && [RCTConvert BOOL:style[@"tapBackgroundToDismiss"]])
|
|
58
|
+ {
|
|
59
|
+ UITapGestureRecognizer *singleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(dismissAnimated)];
|
|
60
|
+ singleTap.delegate = self;
|
|
61
|
+ [self addGestureRecognizer:singleTap];
|
|
62
|
+ }
|
62
|
63
|
}
|
63
|
64
|
|
64
|
65
|
self.reactView = [[RCTRootView alloc] initWithBridge:[[RCCManager sharedInstance] getBridge] moduleName:self.params[@"component"] initialProperties:passProps];
|
|
@@ -76,6 +77,12 @@ const NSInteger kLightBoxTag = 0x101010;
|
76
|
77
|
return self;
|
77
|
78
|
}
|
78
|
79
|
|
|
80
|
+
|
|
81
|
+-(BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch
|
|
82
|
+{
|
|
83
|
+ return ![touch.view isDescendantOfView:self.reactView];
|
|
84
|
+}
|
|
85
|
+
|
79
|
86
|
-(void)layoutSubviews
|
80
|
87
|
{
|
81
|
88
|
[super layoutSubviews];
|