//联系人:石虎QQ: 1224614774昵称:嗡嘛呢叭咪哄
一、初始化UILabel
//定义属性
@property(weak,nonatomic)IBOutletUILabel *shiHuLabel;
二、实现监听UILabel
//初始化并监听
UITapGestureRecognizer*tap = [[UITapGestureRecognizer alloc] initWithTarget:selfaction:@selector(showShiHuTypes)];
//添加到UIlable上面
[self.shiHuLabel addGestureRecognizer:tap];
//允许编译
self.shiHuLabel.userInteractionEnabled =YES;
//取数组第一个元素
self.shiHuLabel.text =self.shiHuArray.firstObject;
三、实现回调
- (IBAction)showShiHuTypes {
//实现点击lable要实现的功能
}
谢谢!!!