Skip to content

Commit dd3dea0

Browse files
author
Remigiusz Herba
committed
Fixed issue with touchesMoved called on devices with 3D Touch screen
1 parent 28ca489 commit dd3dea0

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

MZSelectableLabel/MZSelectableLabel.m

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -454,8 +454,13 @@ - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
454454
- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
455455
{
456456
[super touchesMoved:touches withEvent:event];
457-
458-
self.isTouchMoved = YES;
457+
458+
UITouch *currentTouch = touches.anyObject;
459+
if (!CGPointEqualToPoint([currentTouch locationInView:currentTouch.view],
460+
[currentTouch previousLocationInView:currentTouch.view]))
461+
{
462+
self.isTouchMoved = YES;
463+
}
459464
}
460465

461466
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event

0 commit comments

Comments
 (0)