I have a custom UIButton and I applied touch delegates in a custom button class.
Everything works fine up to the iPhone 6 Plus. All devices above it, such as the iPhone 6s and 7, pose a problem.
When I press the touchesBegan button, it is called as expected, but also calls touchesMoved and creates problems in my code.
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{ _firstTouch = [[touches anyObject]locationInView:self]; _isTapped = YES; [self.nextResponder.nextResponder touchesBegan:touches withEvent:event]; } - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event{ _isTapped = NO; [self.nextResponder.nextResponder touchesMoved:touches withEvent:event]; } - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event{ if (_isTapped){
Why is touchesMoved called on these devices and how can I solve it?
Hassy source share