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

Remove extra string/attributed string creation in accessibility props #1062

Merged
merged 2 commits into from
Aug 3, 2018

Conversation

Adlai-Holler
Copy link
Member

Motivation

We currently create attributed & non-attributed copies of accessibility hint, label, and value whenever you set them. We don't need to – UIKit will bridge between the two worlds for us. Creating attributed strings is actually pretty expensive. So we just update our flags and set whichever one was set most recently.

Changes

  • Remove nonattributed <-> attributed duplication in accessibility properties.
  • In the getters (only used before-node-load), generate the corresponding value on demand.
    • Will almost never be called.
  • Always update "changed" flags to ensure the latest value is applied in the case that the view was given a different value outside of ASPendingState.

@Adlai-Holler Adlai-Holler merged commit e76b4f0 into master Aug 3, 2018
@Adlai-Holler Adlai-Holler deleted the AHFasterAccessibility branch August 3, 2018 17:23
mikezucc pushed a commit to mikezucc/Texture that referenced this pull request Oct 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants