In my program, I have a UITapGestureRecognizer which I have initialized with initWithTarget: action:. I have passed in a selector to call a method by the name of PlanetTapped: (UIImageView *)aPlanet. This calls the method fine, however I would like to know how to pass arguments into action: like you would with performSelector: withObject. Is this popssible? It would make sense to allow you to send arguments to the UIGestureRecognizer‘s selector. Any help is appreciated.
In my program, I have a UITapGestureRecognizer which I have initialized with initWithTarget: action:
Share
The correct signature for the method to call would be:
then you could access the view that received the gesture by calling:
Indeed, this is what UIGestureRecognizer reference states: