Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

如果有大量的string 增加action,页面会卡顿 #72

Open
burning-git opened this issue Nov 29, 2024 · 2 comments
Open

如果有大量的string 增加action,页面会卡顿 #72

burning-git opened this issue Nov 29, 2024 · 2 comments

Comments

@burning-git
Copy link

list = ["s", "b"] // 大量 几千个
for i in list {
var att = ASAttributedString(string: "")
att += .init(string: i, .action {[weak label] in
print("点击单词:", token)

  })
 att +=  .init(string: " ")

}

label 显示 att ,会卡住页面,在tablew 滑动的时候,比较明显,即使 att 做了缓存也是一样。

@lixiang1994
Copy link
Owner

了解, 这是一个已知问题, 我也在想办法优化

@burning-git
Copy link
Author

能不能通过代理来实现这个点击事件的传递呢。
这样就减少了堆占的内存

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants