-
-
Notifications
You must be signed in to change notification settings - Fork 781
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
Crippled performance, sometimes crashing on longer strings #18
Comments
Yes, this operation has a performance issue. func >>(lhs: String, rhs: String) -> Array<LTCharacterDiffResult> I must solve it before adding support for multiline. But I'm not good at algorithm. |
I'm not particularly great at this kind of thing either. I think a simple, quick fix could be possible, in just not animating the diffs after a certain number. In real usage, this may actually be the preferred way to go, as it could look messy animating hundred of characters, even if we get the performance perfect. What do you think, is there a simple way to just cut it off after a certain length (20 or so characters perhaps)? |
It happens not only to long strings, but sometimes if many short strings appear in one controller as well. |
I guess the latest Swift 1.2 comes with a lot of performance enhancements. Please try Xcode 6.3 Beta. |
I think the performance and crashing are just due to inherent design issues. I wish I understood the code enough to modify it. It's a really good effect when it works!
|
👍 UILabel is not designed to take long text. However what is long and not is defined by the use case of your App. Forcing a specific length would make this library unusable for many developers. Instead I would make an effort to optimize the animation so that multiline and long text is not an issue for animation. |
I've found that setting strings longer than about 50 characters crawls to a halt. Sometimes crashes. A simple fix would be to just not animate if the length is greater than a certain number. I attempted to do this by modifying the setter for the text variable, pausing the display link and setting super.text to the value if it was above a threshold. This sometimes works, but I think I'm missing something, as I still get issues with performance. Advice appreciated. Would love to use this in the next rev of Slated if I can get it reliable.
The text was updated successfully, but these errors were encountered: