CPLabel
[](https://travis-ci.org/Hari Krishna/CPLabel)
需求
- ARC
- iOS8
安装
CPLabel 通过 CocoaPods 提供。
针对 CocoaPods 中最新发布的版本
## for swift 2.3 use:
pod 'CPLabel', '~> 0.1.4'
## for swift 3.0 use:
pod 'CPLabel', '~> 0.1.5'
## for swift 4.0 use:
pod 'CPLabel', '~> 0.1.6'
使用
场景图
- 在Identity Inspector中将UITextView拖动并将其Custom Class Name更改为CPLabel
- 在使用的类中导入模块[import CPLabel]。
- 从Storyboard中提供Outlet
示例
import CPLabel
class ViewController: UIViewController {
@IBOutlet weak var textLabel: CPLabel?
override func viewDidLoad() {
super.viewDidLoad()
self.textLabel?.text = "\n\n\nHello World 1234567890 [email protected] "
}
}
特性
-
像UiLable一样使用,具有以下额外功能:
-
复制标签文本
-
识别电话号码、电子邮件ID、搜索等..
-
长按选中的文本以提供查找、发送电子邮件、发送消息、添加到联系人和复制等功能。
作者
Hari Krishna, [邮件受到保护](/cdn-cgi/l/email-protection#f5a6a7a9a7a5a6e797a5b7 Ka8a3a7a5b7a6)
许可
CPLabel基于MIT许可。有关更多信息,请参阅LICENSE文件。