mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-24 04:16:00 +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
@@ -64,6 +64,21 @@
|
||||
|
||||
RCT_NOT_IMPLEMENTED(- (instancetype)initWithTarget:(id)target action:(SEL)action)
|
||||
|
||||
- (void)attachToView:(UIView *)view
|
||||
{
|
||||
RCTAssert(self.view == nil, @"RCTTouchHandler already has attached view.");
|
||||
|
||||
[view addGestureRecognizer:self];
|
||||
}
|
||||
|
||||
- (void)detachFromView:(UIView *)view
|
||||
{
|
||||
RCTAssertParam(view);
|
||||
RCTAssert(self.view == view, @"RCTTouchHandler attached to another view.");
|
||||
|
||||
[view removeGestureRecognizer:self];
|
||||
}
|
||||
|
||||
typedef NS_ENUM(NSInteger, RCTTouchEventType) {
|
||||
RCTTouchEventTypeStart,
|
||||
RCTTouchEventTypeMove,
|
||||
|
||||
Reference in New Issue
Block a user