From c53e3d07f63996459ccb9e2def6435eaf28eeb84 Mon Sep 17 00:00:00 2001
From: Nadine Salter
Commons reasons to subclass includes making a UIView property available and receiving a callback after async
display.
The subclass header ASDisplayNode+Subclasses defines the following methods that either must or can be overriden by -subclasses of ASDisplayNode.
- -These methods should never be called directly by other classes.
- -Implement one of +displayAsyncLayer:parameters:isCancelled: or +drawRect:withParameters:isCancelled: to provide -drawing for your node.
- -Use drawParametersForAsyncLayer: to copy any properties that are involved in drawing into an immutable object for -use on the display queue. The display and drawRect implementations MUST be thread-safe, as they can be called on -the displayQueue (asynchronously) or the main thread (synchronously/displayImmediately).
- -Class methods that require passing in copies of the values are used to minimize the need for locking around instance -variable access, and the possibility of the asynchronous display pass grabbing an inconsistent state across multiple -variables.
-ASDisplayNode provides thread-safe access to most of UIView and CALayer properties and methods, traditionally unsafe.
@@ -650,6 +632,40 @@ or layer property is accessed). + + + + + + backgroundColor
+
+ property
+
+ contentMode
+
+ property
+
+– displayNodeRecursiveDescription
+
+
+
backgroundColor
-
- property
-
- contentMode
-
- property
-
-– displayNodeRecursiveDescription
-
-
-
Use setNeedsDisplayAtScale: to set a value and then after display, the display node will set the layer’s -contentsScale. This is to prevent jumps when re-rasterizing at a different contentsScale. -Read this property if you need to know the future contentsScale of your layer, eg in drawParameters.
+contentsScale. This is to prevent jumps when re-rasterizing at a different contentsScale. +Read this property if you need to know the future contentsScale of your layer, eg in drawParameters.@summary Delegate override to provide new layer contents as a UIImage.
+@summary Delegate override to provide new layer contents as a UIImage.
A UIImage with contents that are ready to display on the main thread. Make sure that the image is already +
A UIImage with contents that are ready to display on the main thread. Make sure that the image is already decoded before returning it here.
@@ -1649,7 +1631,7 @@ decoded before returning it here.@summary Delegate method to draw layer contents into a CGBitmapContext. The current UIGraphics context will be set +
@summary Delegate method to draw layer contents into a CGBitmapContext. The current UIGraphics context will be set to an appropriate context.
YES if the layer is being rasterized into another layer, in which case drawRect: probably wants -to avoid doing things like filling its bounds with a zeroalpha color to clear the backing store.
A point specified in the node’s local coordinate system (bounds).
A point specified in the node’s local coordinate system (bounds).
Subclasses should call this method to invalidate the previously measured and cached size for the display -node, when the contents of the node change in such a way as to require measuring it again.
+node, when the contents of the node change in such a way as to require measuring it again.Marks the receiver’s bounds as needing to be redrawn, with a scale value.
+Marks the receiver’s bounds as needing to be redrawn, with a scale value.
Subclasses should override this if they don’t want their contentsScale changed.
Note: This changes an internal property.
Subclasses should override this if they don’t want their contentsScale changed.
Note: This changes an internal property.