I recommend the simplest (that's what I use): UITapGestureRecognizer with numberOfTapsRequired = 2.
The difference is that it is made specifically for the purpose of doublets. And impossible to detect any performance difference, if ever there were.
If you want to have a different action for single and double tap on theObject, you should create 2 gestures (you could create the gestures in storyboard):
let doubleTap = UITapGestureRecognizer(target: self, action : #selector(self.doubleTapped(tap:)))
doubleTap.numberOfTapsRequired = 2
self.theObject.addGestureRecognizer(doubleTap)
let singleTap = UITapGestureRecognizer(target: self, action: #selector(self.singleTapped(tap:)))
singleTap.numberOfTapsRequired = 1
self.theObject.addGestureRecognizer(singleTap)
// For doubleTap to be detected, avoid interception by single tap: singleTap will fire only if doubleTap has timedout.
singleTap.require(toFail: doubleTap)
And create the appropriate actions:
@objc func singleTapped(tap: UIGestureRecognizer) { }
@objc func doubleTapped(tap: UIGestureRecognizer) { }
I noticed that UIControl.Event defines a large set of events (like .editingChanged, .valueChanged, etc.). Can all these events be applied to any UIControl subclass such as UIButton
No, for instance, editingChanged has no meaning for a button.