Skip to content

Performance trade-off for using NSAttributedString with StyledTextBuilder  #38

Open

Description

@kylelol

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?

Activity

  1. changed the title [-]Performance tradeoff for using Attributed String with StyledTextBuilder [/-] [+]Performance tradeoff for using NSAttributedString with StyledTextBuilder [/+] on Jul 9, 2018
  2. changed the title [-]Performance tradeoff for using NSAttributedString with StyledTextBuilder [/-] [+]Performance trade-off for using NSAttributedString with StyledTextBuilder [/+] on Jul 9, 2018
  3. rnystrom commented on Jul 9, 2018

    @rnystrom
    Member

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions