mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
25 lines
748 B
Swift
25 lines
748 B
Swift
import Foundation
|
|
import UIKit.UIGestureRecognizerSubclass
|
|
|
|
class TouchDownGestureRecognizer: UIGestureRecognizer, UIGestureRecognizerDelegate {
|
|
var touchDown: (() -> Void)?
|
|
|
|
override init(target: Any?, action: Selector?) {
|
|
super.init(target: target, action: action)
|
|
|
|
self.delegate = self
|
|
}
|
|
|
|
func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldRecognizeSimultaneouslyWith otherGestureRecognizer: UIGestureRecognizer) -> Bool {
|
|
return true
|
|
}
|
|
|
|
override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent) {
|
|
super.touchesBegan(touches, with: event)
|
|
|
|
if let touchDown = self.touchDown {
|
|
touchDown()
|
|
}
|
|
}
|
|
}
|