JLLabel
用CoreText實(shí)現(xiàn)類似微博那樣可以點(diǎn)擊的文字,自動(dòng)識(shí)別@,#,http(s)等特殊字符串,用法如下:
JLLabel *contentLabel = [[JLLabel alloc] init];
contentLabel.font = [UIFont systemFontOfSize:15.0];
contentLabel.tapCallBack = ^(NSString *string,NSRange range,NSDictionary *info){
NSLog(@"點(diǎn)擊的字符串是:%@",string);
NSLog(@"點(diǎn)擊的字符串的范圍是:%@",[NSValue valueWithRange:range]);
};
[self.contentView addSubview:contentLabel];

效果圖
下載點(diǎn)擊源代碼