基于Swift插值方式优雅的构建富文本, 支持点击长按事件, 支持不同类型过滤, 支持自定义视图等.
修复以下方式设置action无效的问题:
string.add(attributes: [.action {
print("clicked.")
}], range: .init(location: 3, length: 6))
现支持多Action设置(无数量限制), 且可以同时支持点击与长按类型
例如:
label.attributed.text = """
This is \("Label", .font(.systemFont(ofSize: 50)), .action(clicked), .action(.press, pressed))
"""
PS:
attribute
设置优先级大于observe
设置.解决delaysContentTouches引起的点击响应不灵敏问题
old:
"\(wrap: xxxx)"
new:
"\(xxxx)"
修改类名AttributedString为ASAttributedString, 解决与Xcode13中Foundation.AttributedString类名冲突问题.
修复当视图附件高度小于行高时无效的问题.