I am subclassing UIControl
and as I wanted to set my view controller as the target, I discovered the sendAction method. I can't really figure out the differences between both methods and when their respective usage is more appropriate.
The difference is that sendAction(_:to:for:)
actually calls the defined selector right away, while addTarget(_:action:for:)
only associates a target and action with the control and only calls the selector when the event happens.