1、定义一个tap手势,
UITapGestureRecognizer *tap = [[UITapGestureRecognizeralloc] initWithTarget:selfaction:@selector(eveTap:)];
2、通过uiview给手势设定tag值
UIView *tapView = [tap view];
tapView.tag = 123;
3、在需要的地方可以通过
[tap view].tag取到对应的view
4、需要注意
实际上[tap view].tag取到就是uiimageview的tag值(也就是说通过第二步设定的tag值,相当于重新设置uiimageview的tag值<当然,如果有tag值的话>)。