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 @@ -223,6 +223,37 @@ - (void)animateTarget:(RNGHUIView *)target toOpacity:(CGFloat)opacity scale:(CGF
223223#endif
224224}
225225
226+ #if !TARGET_OS_OSX
227+
228+ - (void )touchesBegan : (NSSet <UITouch *> *)touches withEvent : (UIEvent *)event
229+ {
230+ [super touchesBegan: touches withEvent: event];
231+ UITouch *touch = [touches anyObject ];
232+ if (touch.view != self) {
233+ [self sendActionsForControlEvents: UIControlEventTouchDown];
234+ }
235+ }
236+
237+ - (void )touchesEnded : (NSSet <UITouch *> *)touches withEvent : (UIEvent *)event
238+ {
239+ [super touchesEnded: touches withEvent: event];
240+ UITouch *touch = [touches anyObject ];
241+ if (touch.view != self) {
242+ [self sendActionsForControlEvents: UIControlEventTouchUpInside];
243+ }
244+ }
245+
246+ - (void )touchesCancelled : (NSSet <UITouch *> *)touches withEvent : (UIEvent *)event
247+ {
248+ [super touchesCancelled: touches withEvent: event];
249+ UITouch *touch = [touches anyObject ];
250+ if (touch.view != self) {
251+ [self sendActionsForControlEvents: UIControlEventTouchCancel];
252+ }
253+ }
254+
255+ #endif
256+
226257- (void )handleAnimatePressIn
227258{
228259 RNGHUIView *target = self.animationTarget ?: self;
You can’t perform that action at this time.
0 commit comments