I’m building a complex application with a rich UI, and I need to handle granular events at multiple levels — UIControl events, UIGestureRecognizer events, and even subclass-level events depending on the use case.
For UIControl, I often need to respond to granular events such as .touchUpInside, .touchDown, .touchCancel, etc., which are not fully covered by .primaryActionTriggered. From my understanding, .primaryActionTriggered does not actually reduce the number of addTarget(_:action:for:) calls I need to write — it only simplifies the choice of which event constant to use for a control’s primary action.
So in practice, if my use case requires handling these diverse low-level events, I would still need to explicitly register for each event on each control.
Is this the correct understanding?
Topic:
UI Frameworks
SubTopic:
UIKit
Tags: