File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed
packages/react-native-gesture-handler/apple Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -290,6 +290,37 @@ - (void)animateTarget:(RNGHUIView *)target
290290#endif
291291}
292292
293+ #if !TARGET_OS_OSX
294+
295+ - (void )touchesBegan:(NSSet <UITouch *> *)touches withEvent:(UIEvent *)event
296+ {
297+ [super touchesBegan: touches withEvent: event];
298+ UITouch *touch = [touches anyObject ];
299+ if (touch.view != self) {
300+ [self sendActionsForControlEvents: UIControlEventTouchDown];
301+ }
302+ }
303+
304+ - (void )touchesEnded:(NSSet <UITouch *> *)touches withEvent:(UIEvent *)event
305+ {
306+ [super touchesEnded: touches withEvent: event];
307+ UITouch *touch = [touches anyObject ];
308+ if (touch.view != self) {
309+ [self sendActionsForControlEvents: UIControlEventTouchUpInside];
310+ }
311+ }
312+
313+ - (void )touchesCancelled:(NSSet <UITouch *> *)touches withEvent:(UIEvent *)event
314+ {
315+ [super touchesCancelled: touches withEvent: event];
316+ UITouch *touch = [touches anyObject ];
317+ if (touch.view != self) {
318+ [self sendActionsForControlEvents: UIControlEventTouchCancel];
319+ }
320+ }
321+
322+ #endif
323+
293324- (void )handleAnimatePressIn
294325{
295326 if (_pendingPressOutBlock) {
You can’t perform that action at this time.
0 commit comments