我有一个自定义UIButton,我已经在自定义按钮类中实现了触摸委托. 
  
 
在iPhone 6 Plus之前,每件事情都很好.它上面的所有设备如iPhone 6s和7都会产生问题.
当我单击一个按钮时,touchesBegan按预期调用,但touchesMoved也被调用,它在我的代码中产生问题.
- (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){
    //Functionality
} 
 为什么touchesMoved在这些设备上调用,我该如何解决?
解决方法
 可能是更高分辨率的屏幕对任何移动都更敏感.当你敲击时,你实际上可能正在滚动你的手指,使它看起来像一个小动作. 
  
 
        两种可能的解决方
>在touchesMoved:方法中检查触摸移动了多远.如果这是一个非常小的举动,请忽略它以进行_isTapped检查.>而不是覆盖触摸…方法,使用UITapGestureRecognizer.让它做所有艰苦的工作,确定什么是水龙头,什么不是.它将使您的代码更简单.