UIImageView 添加点击事件

清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>

UIImageView *imageView = [self getYourImageView];  
imageView.image = [self getYourImage];  
imageView.userInteractionEnabled = YES;  
UITapGestureRecognizer *singleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(yourHandlingCode:)];  
[imageView addGestureRecognizer:singleTap];  

//2,获得事件源

-(void)yourHandlingCode:(UIGestureRecognizer *)gestureRecognizer
{
     UIImageView *view = [gestureRecognizer view];
     int tagvalue = view.tag;
}