Skip to content

Instantly share code, notes, and snippets.

@tamassengel
tamassengel / LongPressGestureRecognizer.swift
Last active November 13, 2017 14:55 — forked from myell0w/LongPressGestureRecognizer.swift
A UIGestureRecognizer that fires either on long-press or on a force-touch (3D Touch ™️)
import UIKit.UIGestureRecognizerSubclass
final class MNTLongPressGestureRecognizer: UILongPressGestureRecognizer {
var triggerWithForceTouch = true
override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent) {
super.touchesBegan(touches, with: event)
handleTouches(touches, with: event)
}