UILable如何添加单击事件

//初始化UILable
UILabel *lable = [[UILabel alloc] initWithFrame:CGRectMake(60, 0, 320, 40)];  
 //设置其可以接收用户交互的事件(默认情况下为NO)
  lable.userInteractionEnabled=YES;  
//创建一个手势事件
 UITapGestureRecognizer *labelTapGestureRecognizer = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(labelTouchUpInside:)]; 
//UILable与事件绑定
 [lable addGestureRecognizer:labelTapGestureRecognizer];  

你可能感兴趣的:(iOS,UILabel,单击,绑定,事件)