-
Notifications
You must be signed in to change notification settings - Fork 1
/
ViewController.swift
44 lines (32 loc) · 1.01 KB
/
ViewController.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
//
// ViewController.swift
// SoolyLabelDemo
//
// Created by SoolyChristina on 2017/5/11.
// Copyright © 2017年 SoolyChristina. All rights reserved.
//
import UIKit
class ViewController: UIViewController {
@IBOutlet weak var textLabel: SoolyLabel!
override func viewDidLoad() {
super.viewDidLoad()
let label = SoolyLabel(frame: CGRect(x: 0, y: 200, width: 300, height: 21))
label.text = "Swift#iOS# 测试 http://www.sina.com"
label.font = UIFont.systemFont(ofSize: 12)
label.textColor = UIColor.gray
view.addSubview(label)
label.delegate = self
textLabel.delegate = self
}
}
extension ViewController: SoolyLabelDelegate {
func labelDidSelectedAt(text: String) {
print("点击了\(text)用户")
}
func labelDidSelectedLink(text: String) {
print("点击了\(text)链接")
}
func labelDidSelectedTopic(text: String) {
print("点击了\(text)话题")
}
}