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

Performance trade-off for using NSAttributedString with StyledTextBuilder #38

Open
kylelol opened this issue Jul 9, 2018 · 1 comment

Comments

@kylelol
Copy link
Collaborator

kylelol commented Jul 9, 2018

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?

@kylelol kylelol changed the title Performance tradeoff for using Attributed String with StyledTextBuilder Performance tradeoff for using NSAttributedString with StyledTextBuilder Jul 9, 2018
@kylelol kylelol changed the title Performance tradeoff for using NSAttributedString with StyledTextBuilder Performance trade-off for using NSAttributedString with StyledTextBuilder Jul 9, 2018
@rnystrom
Copy link
Member

rnystrom commented 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!

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

No branches or pull requests

2 participants