mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 14:20:20 +00:00
Add support for providing additional info to network image node delegate (#775)
* Add support for piping arbitrary user info from ASImageDownloader to the ASNetworkImageNodeDelegate * s/source/sourceType * Fix stuff and take Michael's advice
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@protocol ASNetworkImageNodeDelegate, ASImageCacheProtocol, ASImageDownloaderProtocol;
|
||||
@class ASNetworkImageLoadInfo;
|
||||
|
||||
|
||||
/**
|
||||
@@ -134,20 +135,6 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
#pragma mark -
|
||||
|
||||
typedef NS_ENUM(NSInteger, ASNetworkImageSource) {
|
||||
ASNetworkImageSourceUnspecified = 0,
|
||||
ASNetworkImageSourceSynchronousCache,
|
||||
ASNetworkImageSourceAsynchronousCache,
|
||||
ASNetworkImageSourceFileURL,
|
||||
ASNetworkImageSourceDownload,
|
||||
};
|
||||
|
||||
/// A struct that carries details about ASNetworkImageNode's image loads.
|
||||
typedef struct {
|
||||
/// The source from which the image was loaded.
|
||||
ASNetworkImageSource imageSource;
|
||||
} ASNetworkImageNodeDidLoadInfo;
|
||||
|
||||
/**
|
||||
* The methods declared by the ASNetworkImageNodeDelegate protocol allow the adopting delegate to respond to
|
||||
* notifications such as finished decoding and downloading an image.
|
||||
@@ -161,11 +148,11 @@ typedef struct {
|
||||
*
|
||||
* @param imageNode The sender.
|
||||
* @param image The newly-loaded image.
|
||||
* @param info Misc information about the image load.
|
||||
* @param info Additional information about the image load.
|
||||
*
|
||||
* @discussion Called on a background queue.
|
||||
*/
|
||||
- (void)imageNode:(ASNetworkImageNode *)imageNode didLoadImage:(UIImage *)image info:(ASNetworkImageNodeDidLoadInfo)info;
|
||||
- (void)imageNode:(ASNetworkImageNode *)imageNode didLoadImage:(UIImage *)image info:(ASNetworkImageLoadInfo *)info;
|
||||
|
||||
/**
|
||||
* Notification that the image node finished downloading an image.
|
||||
|
||||
Reference in New Issue
Block a user