给UILabel添加点击事件
2020-05-19 本文已影响0人
唐人街的乞丐
允许UILabel 跟用户的交互事件
_addressLabel.userInteractionEnabled = YES;
添加事件
UITapGestureRecognizer * tapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(chooseAddress)];
[_addressLabel addGestureRecognizer:tapGesture];