UITapGestureRecognizer selector, sender is the gesture, not the ui object

后端 未结 4 616
难免孤独
难免孤独 2021-01-31 07:47

I have a series of imageviews that I identify using their tag. I have added a single tap gesture to the images.

UITapGestureRecognizer *singleTap = [[UITapGest         


        
4条回答
  •  一生所求
    2021-01-31 08:13

    I figured out how to get the tag, which was the most important part of the question for me. Since the gesture is the sender, I figured out the the view it is attached to is sent along with it:

    [(UIGestureRecognizer *)sender view].tag
    

    I am still curious if anyone can tell me how to send an argument through a UITapGestureRecognizer selector.

提交回复
热议问题