optonaut / ActiveLabel.swift

UILabel drop-in replacement supporting Hashtags (#), Mentions (@) and URLs (http://) written in Swift
MIT License
4.47k stars 686 forks source link

ActiveLabel lags UI #109

Closed NikKovIos closed 8 years ago

NikKovIos commented 8 years ago

UI lags, when i use active label in UITableViewCell, when scrolling. It takes some time to define hashtags and other things. I also use UITableViewAutomaticDimension, but it affects not much. Testing on iPhone 4S. I'm writing just to figure out is it a normal behaviour, or there are some things in framework, that you can dispatch to background?

polqf commented 8 years ago

That's a thing that we are aware of, but would like to improve. Dispatching ui changes to background is not a good idea, so we try to improve it as much as we can. ActiveLabel runs regexes to be able to highlight the elements. I recently introduced a change that allows you to enable only the desired types you want to highlight. (If you only enable the necessary types you need, less time is required for rendering. Keep in mind that by default URL, mentions and hashtags are enabled)

That said, performance improvements is a ongoing task I am working on

daurenm commented 6 years ago

Seems like it's still laggy during scrolling inside cells of tableView(

Did someone manage to solve this problem with blocking main thread? :)