iOS通过手势拿到当前的View

  UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapAction:)];

- (void)tapAction:(id)sender{
    
    UITapGestureRecognizer *tap = (UITapGestureRecognizer *)sender;
    UIView *view = tap.view;
    NSInteger num = view.tag;
    if (_delegate && [_delegate respondsToSelector:@selector(imgClickWtinTag:) ]) {
        
        [_delegate imgClickWtinTag:num];
    }
}
原文地址:https://www.cnblogs.com/ios988/p/6069445.html