找了好久麻蛋--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-----頭像被點擊了");
}