mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-26 13:25:51 +08:00
Nobody outside RCTTouchHandler should treat it as UIGestureRecognizer subclass
Reviewed By: mmmulani Differential Revision: D4387821 fbshipit-source-id: 8060772a5de669eeaca159ceac13b995d7518a1b
This commit is contained in:
committed by
Facebook Github Bot
parent
2e4be1c2c9
commit
47f18bdb17
@@ -9,6 +9,8 @@
|
||||
|
||||
#import "RCTModalHostView.h"
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
#import "RCTAssert.h"
|
||||
#import "RCTBridge.h"
|
||||
#import "RCTModalHostViewController.h"
|
||||
@@ -16,8 +18,6 @@
|
||||
#import "RCTUIManager.h"
|
||||
#import "UIView+React.h"
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@implementation RCTModalHostView
|
||||
{
|
||||
__weak RCTBridge *_bridge;
|
||||
@@ -87,7 +87,7 @@ RCT_NOT_IMPLEMENTED(- (instancetype)initWithCoder:coder)
|
||||
{
|
||||
RCTAssert(_reactSubview == nil, @"Modal view can only have one subview");
|
||||
[super insertReactSubview:subview atIndex:atIndex];
|
||||
[subview addGestureRecognizer:_touchHandler];
|
||||
[_touchHandler attachToView:subview];
|
||||
subview.autoresizingMask = UIViewAutoresizingFlexibleHeight |
|
||||
UIViewAutoresizingFlexibleWidth;
|
||||
|
||||
@@ -99,7 +99,7 @@ RCT_NOT_IMPLEMENTED(- (instancetype)initWithCoder:coder)
|
||||
{
|
||||
RCTAssert(subview == _reactSubview, @"Cannot remove view other than modal view");
|
||||
[super removeReactSubview:subview];
|
||||
[subview removeGestureRecognizer:_touchHandler];
|
||||
[_touchHandler detachFromView:subview];
|
||||
_reactSubview = nil;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user