Merge pull request #787 from nriley/master

Make 3D Touch work to bring up contextual menus.
This commit is contained in:
Samuel Clay 2015-10-26 09:27:07 -07:00
commit f053eafa0f

View file

@ -56,12 +56,21 @@
case UITouchPhaseEnded:
[contextualMenuTimer invalidate];
contextualMenuTimer = nil;
if (unmoved) {
[self tapAction];
}
break;
case UITouchPhaseMoved:
case UITouchPhaseMoved: // Changes in force are also "moves"
if (CGPointEqualToPoint([touch locationInView:self], tapLocation)) {
if (touch.force > 0.75) {
[contextualMenuTimer invalidate];
contextualMenuTimer = nil;
[self tapAndHoldAction:nil];
}
break;
}
case UITouchPhaseCancelled:
unmoved = NO;
[contextualMenuTimer invalidate];