一个交互式的 UILabel,可以自动检测 URLs、@username、#话题#。
import FFLabel
label.text = "#FFLabel#This is a @FFLabel Demo, access http://github.com/liufan321/fflabel can get the demo project. Follow @liufan2000 to get more information."
class ViewController: UIViewController, FFLabelDelegate
func labelDidSelectedLinkText(label: FFLabel, text: String) {
print(text)
}
#import "FFLabelObjcDemo-Swift.h"
self.label.labelDelegate = self;
self.label.text = @"#FFLabel#This is a @FFLabel Demo, access http://github.com/liufan321/fflabel can get the demo project. Follow @liufan2000 to get more information.";
@interface ViewController () <FFLabelDelegate>
- (void)labelDidSelectedLinkText:(FFLabel * __nonnull)label text:(NSString * __nonnull)text {
NSLog(@"%@", text);
}
FFLabel 在 MIT 许可下发布。有关详细信息,请参阅 LICENSE。