Skip to content

Instantly share code, notes, and snippets.

View dyrkabes's full-sized avatar

Pavel dyrkabes

  • Hamburg
View GitHub Profile
/**
A small gesture recogniser that does not need any hustle for those who does not like associated objects and other tough stuff.
And it doesn't need to be stored somewhere. Works like a regular GR. Though it has some limitations - it's inherited from `UITapGestureRecognizer`.
So it knows only how to handle taps. But do we often need all the types there are? Personally me not.
Seems handy for me to purify our view controller from those `@objc` one liners and to become a bit more.. reactive?
*/
final class BindableGestureRecognizer: UITapGestureRecognizer {
private var action: () -> Void