FFLabel 0.0.3

FFLabel 0.0.3

测试已测试
语言语言 SwiftSwift
许可证 MIT
发布最后发布2016年3月
SPM支持 SPM

Fan Liu 维护。



FFLabel 0.0.3

  • Fan Liu

FFLabel

一个交互式的 UILabel,可以自动检测 URLs、@username、#话题#。

屏幕截图

FFLabel

要求

  • iOS 8.0+
  • Xcode 7.0 预览版
  • Swift 2.0

安装

用法

Swift

  • 导入框架
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)
}

Objective-C

  • 导入 "ProjectName-Swift.h"
#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。