@@ -42,6 +42,17 @@ class CheckingViewController: ViewController<CheckingView> {
4242 string. add ( attributes: [ . foreground( #colorLiteral( red: 0.9529411793 , green: 0.6862745285 , blue: 0.1333333403 , alpha: 1 ) ) , . font( . systemFont( ofSize: 20 , weight: . medium) ) ] , checkings: [ . phoneNumber] )
4343 string. add ( attributes: [ . foreground( #colorLiteral( red: 0.1764705926 , green: 0.4980392158 , blue: 0.7568627596 , alpha: 1 ) ) , . font( . systemFont( ofSize: 20 , weight: . medium) ) ] , checkings: [ . link] )
4444 string. add ( attributes: [ . foreground( #colorLiteral( red: 0.1764705926 , green: 0.01176470611 , blue: 0.5607843399 , alpha: 1 ) ) , . font( . systemFont( ofSize: 20 , weight: . medium) ) ] , checkings: [ . date] )
45+
46+ // 测试action
47+ // string.add(attributes: [.action {
48+ // print("11")
49+ // }], range: .init(location: 3, length: 6))
50+ // string.add(attributes: [.action {
51+ // print("22")
52+ // },.action {
53+ // print("33")
54+ // }], checkings: [.link])
55+
4556 container. label. attributed. text = string
4657 }
4758
@@ -54,6 +65,17 @@ class CheckingViewController: ViewController<CheckingView> {
5465 string. add ( attributes: [ . foreground( #colorLiteral( red: 0.1764705926 , green: 0.01176470611 , blue: 0.5607843399 , alpha: 1 ) ) ] , checkings: [ . date] )
5566 string. add ( attributes: [ . foreground( #colorLiteral( red: 0.9098039269 , green: 0.4784313738 , blue: 0.6431372762 , alpha: 1 ) ) ] , checkings: [ . regex( " Li Xiang " ) ] )
5667 string. add ( attributes: [ . font( . systemFont( ofSize: 16 , weight: . medium) ) ] , checkings: [ . action] )
68+
69+ // 测试action
70+ // string.add(attributes: [.action {
71+ // print("11")
72+ // }], range: .init(location: 3, length: 6))
73+ // string.add(attributes: [.action {
74+ // print("22")
75+ // },.action {
76+ // print("33")
77+ // }], checkings: [.link])
78+
5779 container. textView. attributed. text = string
5880 }
5981
0 commit comments