关于UIImageView 添加UITapGestureRecognizer后传参的问题

             img.userInteractionEnabled = YES;

        UITapGestureRecognizer *singleTap = [[UITapGestureRecognizer allocinitWithTarget:self action:@selector(clickEvent:)];

        [mView addGestureRecognizer:singleTap];

        singleTap.view.tag = 123456;

        [cell.contentView addSubView:mView;


-(void)clickEvent:(id)sender

{

    UITapGestureRecognizer *tap = (UITapGestureRecognizer*)sender;


    UIView *views = (UIView*) tap.view;


    NSUInteger tag = views.tag;

}


你可能感兴趣的:(关于UIImageView 添加UITapGestureRecognizer后传参的问题)