找了好久麻蛋--OBJC--
点击头像进入主页
-(void)awakeFromNib
/**
点击用户名字
*/
UITapGestureRecognizer *onClickNameLabel = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(onClickNameLabel:)];
[self.nameLabel addGestureRecognizer:onClickNameLabel];
[self.contentView addGestureRecognizer:onClickNameLabel];
-
(void)reloadDetaiViewWithFeedStyle:(UMComFeedStyle *)feedStyle viewWidth:(CGFloat)viewWidth
/**
点击用户头像
*/UITapGestureRecognizer *tapGR = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(clickHeadImage:)]; _portrait.userInteractionEnabled = YES; [_portrait addGestureRecognizer:tapGR];
输出打印结果
pragma mark - Click Head Image NameLabel
-(void)onClickNameLabel:(UITapGestureRecognizer *)sender
{
NSLog(@"-----Objc-----名字被点击了");
}
-(void)clickHeadImage:(UITapGestureRecognizer *)senderr
{
NSLog(@"-----Objc-----头像被点击了");
}