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

ASTextNode2 crashes when used with transitionLayout shouldMeasureAsync:true #767

Closed
jinlee opened this issue Jan 25, 2018 · 0 comments
Closed

Comments

@jinlee
Copy link

jinlee commented Jan 25, 2018

Crash output:

0   CoreFoundation     0x000000010506212b __exceptionPreprocess + 171
1   libobjc.A.dylib    0x00000001046f6f41 objc_exception_throw + 48
2   CoreFoundation     0x00000001050672f2 +[NSException raise:format:arguments:] + 98
3   Foundation         0x0000000104197d69 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 193
4   AsyncDisplayKit    0x0000000103bb99e2 -[ASDisplayNode(UIViewBridge) backgroundColor] + 418
5   AsyncDisplayKit    0x0000000103d221df -[ASTextNode2 prepareAttributedStringForDrawing:] + 463
6   AsyncDisplayKit    0x0000000103d213ec -[ASTextNode2 calculateSizeThatFits:] + 1052

So the flow for calculating size that fits for ASTextNode2 is currently the following:

  • calculateSizeThatFits relies on prepareAttributedStringForDrawing
  • prepareAttributedStringForDrawing reads backgroundColor (it's not clear to me why this is required)
  • backgroundColor asserts ASDisplayNodeAssertThreadAffinity

This is an issue when using transitionLayout(animated: true, shouldMeasureAsync: true).

I've played around with commenting out the color handling in prepareAttributedStringForDrawing and I've found that this fixes the issue.

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

No branches or pull requests

1 participant