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

Antoine/swift6 #6

Open
wants to merge 17 commits into
base: muukii/investigate-layout-assertion
Choose a base branch
from

Conversation

ntnmrndn
Copy link

No description provided.

@ntnmrndn ntnmrndn changed the base branch from muukii/cleanup-spm to muukii/investigate-layout-assertion November 29, 2024 02:44
@@ -209,7 +209,7 @@ ASDK_EXTERN NSInteger const ASDefaultDrawingPriority;
* @warning The first access to it must be on the main thread, and should only be used on the main thread thereafter as
* well.
*/
@property (readonly) UIView *view;
@property (readonly) NS_SWIFT_UI_ACTOR UIView *view;
Copy link

@JohnEstropia JohnEstropia Dec 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The documentation explains this: Only the first access (factory) is required to be in the main thread. Subsequent accesses may be called from background threads as both the view and layers may be passed between nodes and closures

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure, do you mean the comment is wrong ? reading it I explicitly understand it as main thread only

Copy link

@JohnEstropia JohnEstropia Dec 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The first access to it must be on the main thread, and should only be used on the main thread thereafter as well.

The latter part refers to the view/layer instance itself (which is a UIKit rule more than Textures), not the property. If you check the internal implementation of - (UIView *)view on ASDisplaynode.mm, the main thread assertion is only when the view needs to be created. The same is true for - (CALayer *)layer. Texture needs to access this internally even if the node itself is meant for background use.

@@ -234,7 +234,7 @@ ASDK_EXTERN NSInteger const ASDefaultDrawingPriority;
* @warning The first access to it must be on the main thread, and should only be used on the main thread thereafter as
* well.
*/
@property (readonly) CALayer * layer;
@property (readonly) NS_SWIFT_UI_ACTOR CALayer * layer;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment here

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

Successfully merging this pull request may close these issues.

2 participants