-
Notifications
You must be signed in to change notification settings - Fork 3
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
base: muukii/investigate-layout-assertion
Are you sure you want to change the base?
Antoine/swift6 #6
Conversation
@@ -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; |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment here
No description provided.