Skip to content

重构Action

Compare
Choose a tag to compare
@lixiang1994 lixiang1994 released this 10 Mar 12:10
· 32 commits to master since this release

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

例如:

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

PS:

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