iOS 监听UILabel点击

 label.userInteractionEnabled = YES; // 一定要设置
 [label addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(labelClick:)]];

- (void)labelClick:(UITapGestureRecognizer *)tap{

    NSLog(@"%@",tap.view);

}

 

 

posted @ 2017-02-14 14:57  低头捡到蛋  阅读(775)  评论(0编辑  收藏  举报