Skip to content

Releases: lixiang1994/AttributedString

补充属性设置方式

22 Apr 10:45
Compare
Choose a tag to compare
var string = ASAttributedString("XXX")
string.add(attributes: [.foreground(.red)], range: .init(location: 0, length: string.length))
string.set(attributes: [.foreground(.red)], range: .init(location: 0, length: string.length)) 
label.attributed.text = string

equal

label.attributed.text = ASAttributedString("XXX").add(attributes: .foreground(.red)).set(attributes: .foreground(.red))

优化Action合并

14 Mar 04:33
Compare
Choose a tag to compare

修复以下方式设置action无效的问题:

string.add(attributes: [.action {
    print("clicked.")
}], range: .init(location: 3, length: 6))

重构Action

10 Mar 12:10
Compare
Choose a tag to compare

现支持多Action设置(无数量限制), 且可以同时支持点击与长按类型

例如:

label.attributed.text = """
This is \("Label", .font(.systemFont(ofSize: 50)), .action(clicked), .action(.press, pressed))
"""

PS:

  • 当两段字符串同时被设置了点击高亮的效果, 长度较短的字符串优先.
  • 多个Action的回调触发顺序与设置顺序一致, attribute设置优先级大于observe设置.

fix SPM warning

17 Dec 04:05
Compare
Choose a tag to compare
2.2.2

update actions

优化内部touches响应顺序 解决极端情况的异常

29 Oct 09:21
Compare
Choose a tag to compare
2.2.1

2.2.1, 内部优化touches与手势的响应顺序

解决UITableView等控件中点击不灵敏的问题

06 Aug 08:12
Compare
Choose a tag to compare

解决delaysContentTouches引起的点击响应不灵敏问题

优化富文本嵌套插值方法

24 Jul 03:24
Compare
Choose a tag to compare

old:

"\(wrap: xxxx)"

new:

"\(xxxx)"

该来的还是来了

15 Jul 09:10
Compare
Choose a tag to compare

修改类名AttributedString为ASAttributedString, 解决与Xcode13中Foundation.AttributedString类名冲突问题.

优化super.touches调用

17 Mar 06:50
Compare
Choose a tag to compare

优化UILabel点击计算, 修复换行符问题

02 Sep 11:01
Compare
Choose a tag to compare
1.6.8

优化UILabel点击计算, 修复换行符问题