Skip to content

用CoreText实现类似微博那样可以点击的文字,自动识别@,#,http(s)等特殊字符串

Notifications You must be signed in to change notification settings

JlongTian/JLLabel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JLLabel

用CoreText实现类似微博那样可以点击的文字,自动识别@,#,http(s)等特殊字符串,用法如下:

JLLabel *contentLabel = [[JLLabel alloc] init];
contentLabel.font = [UIFont systemFontOfSize:15.0];
contentLabel.tapCallBack = ^(NSString *string,NSRange range,NSDictionary *info){
            
     NSLog(@"点击的字符串是:%@",string);
     NSLog(@"点击的字符串的范围是:%@",[NSValue valueWithRange:range]);
  
 };
[self.contentView addSubview:contentLabel];
 

效果图:

效果图

About

用CoreText实现类似微博那样可以点击的文字,自动识别@,#,http(s)等特殊字符串

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published