diff --git a/submodules/ContextUI/Sources/ContextGesture.swift b/submodules/ContextUI/Sources/ContextGesture.swift index e6c7c1a078..3843d577e2 100644 --- a/submodules/ContextUI/Sources/ContextGesture.swift +++ b/submodules/ContextUI/Sources/ContextGesture.swift @@ -139,19 +139,22 @@ public final class ContextGesture: UIGestureRecognizer, UIGestureRecognizerDeleg super.touchesMoved(touches, with: event) if let touch = touches.first { - /*if #available(iOS 9.0, *) { + if #available(iOS 9.0, *) { let maxForce: CGFloat = max(2.5, min(3.0, touch.maximumPossibleForce)) - let progress = touch.force / maxForce - self.currentProgress = progress - if self.isValidated { - self.activationProgress?(progress, .update) - } if touch.force >= maxForce { + if !self.isValidated { + self.isValidated = true + } + switch self.state { case .possible: self.delayTimer?.invalidate() + self.animator?.invalidate() self.activated?(self) if let view = self.view?.superview { + if let window = view.window { + cancelOtherGestures(gesture: self, view: window) + } cancelParentGestures(view: view) } self.state = .began @@ -159,7 +162,7 @@ public final class ContextGesture: UIGestureRecognizer, UIGestureRecognizerDeleg break } } - }*/ + } self.externalUpdated?(self.view, touch.location(in: self.view)) }