[ASTextNode] Prompt creation of truncater object when the context object is accessed. - #1110
Conversation
|
@yury what exactly is the dependency here? Why doesn't the truncater get accessed, e.g. [self truncater] get called, at a later point as soon as it is required? Thanks a lot for looking at this! |
|
@appleguy as my debugging shows, Truncated should be initialized ahead of size calculation so it can actually truncate string in it's initializer. |
|
@yury thank you for those additional details. It is still mysterious to me why this object has to be created ahead of time and I wonder if there is a later point than init where it can be created, as init may occur on the main thread, but none of our sizing calculations occur there. If you're able to share a test case, I can verify, but it's possible the perf impact of this is negligible with the current factoring of the code (it used to be measurable as suboptimal). |
|
Merging this for correctness now, optimization later with a test case. Please email me at asyncdisplaykit@gmail.com with any other thoughts! cc @tomizimobile |
[ASTextNode] Prompt creation of truncater object when the context object is accessed.
|
@tomizimobile will check tomorrow. |
|
@appleguy, @tomizimobile confirming that textNodeTappedTruncationToken doesn't called. And confirming, that @tomizimobile workaround fixes this. @tomizimobile can you make PR? |


See comment
Fixes #865.
attributedString on ASTextNode should be set after all truncationStrings...