Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save aybekckaya/e4f71b1618372f1ee0e7a08b325c4096 to your computer and use it in GitHub Desktop.
Save aybekckaya/e4f71b1618372f1ee0e7a08b325c4096 to your computer and use it in GitHub Desktop.
class LikeGestureRecognizer:UIGestureRecognizer {
override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent) {
super.touchesBegan(touches, with: event)
self.state = .began
}
override func touchesMoved(_ touches: Set<UITouch>, with event: UIEvent) {
super.touchesMoved(touches, with: event)
self.state = .changed
}
override func touchesEnded(_ touches: Set<UITouch>, with event: UIEvent) {
super.touchesEnded(touches, with: event)
self.state = .ended
}
override func touchesCancelled(_ touches: Set<UITouch>, with event: UIEvent) {
super.touchesCancelled(touches, with: event)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment