https://github.com/targetcloud/tglabel
https://github.com/targetcloud/tglabel
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/targetcloud/tglabel
- Owner: targetcloud
- License: mit
- Created: 2017-03-03T08:35:02.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-08-08T13:36:47.000Z (over 8 years ago)
- Last Synced: 2025-04-11T23:47:11.830Z (about 1 year ago)
- Language: Swift
- Size: 1.02 MB
- Stars: 4
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README

## TGLabel
一款可以根据传入的正则表达式自动匹配文本中的子文本对象,子文本对象按自定义方式显示和事件交互处理的UILabel。






## Features
- [x] 支持正则匹配子文本
- [x] 支持文字改变时自适应高度
## Usage
```
@IBOutlet weak var testLbl: TGLabel!
override func viewDidLoad() {
super.viewDidLoad()
// testLbl.autoresizingHeight = true
testLbl.text = "TGLabel 感谢你使用TGLabel 欢迎你star/issue https://github.com/targetcloud/TGLabel"
}
override func touchesBegan(_ touches: Set, with event: UIEvent?) {
testLbl.autoresizingHeight = true
testLbl.text = "我变了,我真的变了,https://github.com/targetcloud/TGLabel https://github.com/targetcloud https://github.com"
}
```

### 可以配置的属性
```
patterns 正则
delegate 代理
adjustCoefficient 选中时的高度调整系数
autoresizingHeight 自适应高度
selectedBackgroudColor 选中背景色
linkTextColor 选中色
text 文本
attributedText 同上
font 字体
textColor 普通文本色
```
### 更多使用配置组合效果请下载本项目或fork本项目查看
## Installation
- 下载并拖动TGLabel到你的工程中
- Cocoapods
```
pod 'TGLabel'
```
## Reference
- http://blog.csdn.net/callzjy
## 运行效果

如果你觉得赞,请Star
