FWAsyncLayerDisplayTask
@interface FWAsyncLayerDisplayTask : NSObject
A display task used by FWAsyncLayer to render the contents in background queue.
-
This block will be called before the asynchronous drawing begins. It will be called on the main thread.
block param layer: The layer.
Declaration
Objective-C
@property (nonatomic, copy, nullable) void (^) (CALayer *_Nonnull __strong) willDisplay;
-
This block is called to draw the layer’s contents.
Note
This block may be called on main thread or background thread, so is should be thread-safe.block param context: A new bitmap content created by layer. block param size: The content size (typically same as layer’s bound size). block param isCancelled: If this block returns
YES
, the method should cancel the drawing process and return as quickly as possible.Declaration
Objective-C
@property (nonatomic, copy, nullable) void (^) (CGContextRef _Nonnull, CGSize, BOOL (^_Nonnull __strong)(void)) display;
-
This block will be called after the asynchronous drawing finished. It will be called on the main thread.
block param layer: The layer. block param finished: If the draw process is cancelled, it’s
NO
, otherwise it’sYES
.Declaration
Objective-C
@property (nonatomic, copy, nullable) void (^) (CALayer *_Nonnull __strong, BOOL) didDisplay;