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

Update documentation of ASNetworkImageNodeDelegate #trivial #1163

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 11 additions & 9 deletions Source/ASNetworkImageNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,15 @@ NS_ASSUME_NONNULL_BEGIN
@protocol ASNetworkImageNodeDelegate <NSObject>
@optional

/**
* Notification that the image node started to load
*
* @param imageNode The sender.
*
* @discussion Called on the main thread.
*/
- (void)imageNodeDidStartFetchingData:(ASNetworkImageNode *)imageNode;

/**
* Notification that the image node finished downloading an image, with additional info.
* If implemented, this method will be called instead of `imageNode:didLoadImage:`.
Expand All @@ -167,15 +176,6 @@ NS_ASSUME_NONNULL_BEGIN
*/
- (void)imageNode:(ASNetworkImageNode *)imageNode didLoadImage:(UIImage *)image;

/**
* Notification that the image node started to load
*
* @param imageNode The sender.
*
* @discussion Called on a background queue.
*/
- (void)imageNodeDidStartFetchingData:(ASNetworkImageNode *)imageNode;

/**
* Notification that the image node failed to download the image.
*
Expand All @@ -190,6 +190,8 @@ NS_ASSUME_NONNULL_BEGIN
* Notification that the image node finished decoding an image.
*
* @param imageNode The sender.
*
* @discussion Called on the main thread.
*/
- (void)imageNodeDidFinishDecoding:(ASNetworkImageNode *)imageNode;

Expand Down
2 changes: 2 additions & 0 deletions Source/ASNetworkImageNode.mm
Original file line number Diff line number Diff line change
Expand Up @@ -614,6 +614,8 @@ - (void)_downloadImageWithCompletion:(void (^)(id <ASImageContainerProtocol> ima

- (void)_lazilyLoadImageIfNecessary
{
ASDisplayNodeAssertMainThread();

[self lock];
__weak id<ASNetworkImageNodeDelegate> delegate = _delegate;
BOOL delegateDidStartFetchingData = _delegateFlags.delegateDidStartFetchingData;
Expand Down