You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Performance trade-off for using NSAttributedString with StyledTextBuilder #38
Just curious as if there is a performance tradeoff for creating an attributed string, and then using the convenience initializer of the StyledTextBuilder that takes in an attributed string vs just using the StyledTextedBuilder API to build up a string? Does this affect the background rendering as well?
changed the title [-]Performance tradeoff for using Attributed String with StyledTextBuilder [/-][+]Performance tradeoff for using NSAttributedString with StyledTextBuilder [/+]on Jul 9, 2018
changed the title [-]Performance tradeoff for using NSAttributedString with StyledTextBuilder [/-][+]Performance trade-off for using NSAttributedString with StyledTextBuilder [/+]on Jul 9, 2018
Would love to explore this idea a bit! The big downside with using an NSAttributedString is that you can't change any UIFont properties based on system text size. I originally designed this so that you can build a string once, but then render it multiple times when the device text size changes.
One idea brought up in #25 is to cache NSAttributedString building given string + content size input. That'd be win-win!
Activity
[-]Performance tradeoff for using Attributed String with StyledTextBuilder [/-][+]Performance tradeoff for using NSAttributedString with StyledTextBuilder [/+][-]Performance tradeoff for using NSAttributedString with StyledTextBuilder [/-][+]Performance trade-off for using NSAttributedString with StyledTextBuilder [/+]rnystrom commentedon Jul 9, 2018
Would love to explore this idea a bit! The big downside with using an
NSAttributedStringis that you can't change anyUIFontproperties based on system text size. I originally designed this so that you can build a string once, but then render it multiple times when the device text size changes.One idea brought up in #25 is to cache
NSAttributedStringbuilding given string + content size input. That'd be win-win!