in ASTextNode, bail from touchesMoved:withEvent: if the previousLocationInView is the same as the locationInView. On 3D Touch enabled phones, this gets fired with chages in force, and will usually get fired immediately after touchedBegan:withEvent, causing touches to usually be cancelled

This commit is contained in:
Tom King
2016-03-07 17:15:30 -05:00
parent 9e72679ffd
commit f4d5791717

View File

@@ -891,6 +891,10 @@ static NSArray *DefaultLinkAttributeNames = @[ NSLinkAttributeName ];
{
[super touchesMoved:touches withEvent:event];
// on 3D Touch enabled phones, this gets fired with changes in force, and usually will get fired immediately after touchesBegan:withEvent:
if (CGPointEqualToPoint([[touches anyObject] previousLocationInView:self.view], [[touches anyObject] locationInView:self.view]))
return;
// If touch has moved out of the current highlight range, clear the highlight.
if (_highlightRange.length > 0) {
NSRange range = NSMakeRange(0, 0);