When a UIView is assigned to a UITapGestureRecognizer , it is passed a reference to the target (by the way, tell it what it is?) And a selector is a reference to the method that is called by clicking on the UIView .

Interested in the opportunity to get a link to the UIView for which Tap was made in the body of the method that handles a click on this UIView . In Android, this is provided by default, how can you implement this in iOS?

    1 answer 1

    Did you try to read the documentation ?

    1) Target - this is what class the method should perform after clicking (selector - this is what method in the class indicated above should be executed)

    2) UIGestureRecognizer has a view property - this is what kind of viewer the attachment driver is attached to, respectively, tap always has this view

    • mmm, we can cling any methods to recognizer, like Class.func, Class.func (_ :), and Clacc.func (_: a: b: c: ... n :), already figured out what to do if func (gestureRecognizer: UITapGestureRecognizer), then respectively the fixer tied to the UIView will be passed to the function, which generally solves my problem. But the question arises - how is this implemented and what will happen in other cases? Is there any documentation on this topic that you can study? - iamthevoid