label 显示不同颜色 不同文字点击事件

用到一个  textcolortap    感谢作者


      ShowNameStr =[NSString stringWithFormat:@"%@ 回复%@",_reply.createBy,_reply.replyToUserName];


    NSDictionary* style3 = @{@"body":[UIFont fontWithName:@"HelveticaNeue" size:16.0],
                             @"help":[WPAttributedStyleAction styledActionWithAction:^{
                                 //  文字的点击事件
                             }],
                             @"link": [UIColor colorWithHexString:@"#2465a7"]};

     self.TitleName.userInteractionEnabled = YES;
     self.TitleName.attributedText = [ShowNameStr attributedStringWithStyleBook:style3];

你可能感兴趣的:(iOS,开发)