为UIImageView添加单击事件

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

你可能感兴趣的:(为UIImageView添加单击事件)