Downstream ASAnimatedImage

This commit is contained in:
Garrett Moon
2016-04-05 18:05:51 -07:00
parent beba9031ef
commit 1b316217ef
11 changed files with 109 additions and 1007 deletions

View File

@@ -11,6 +11,8 @@
NS_ASSUME_NONNULL_BEGIN
@protocol ASAnimatedImageProtocol;
@protocol ASImageContainerProtocol <NSObject>
- (UIImage *)asdk_image;
@@ -83,6 +85,12 @@ typedef NS_ENUM(NSUInteger, ASImageDownloaderPriority) {
@optional
/**
@abstract Return an object that conforms to ASAnimatedImageProtocol
@param animatedImageData Data that represents an animated image.
*/
- (nullable id <ASAnimatedImageProtocol>)animatedImageWithData:(NSData *)animatedImageData;
//You must implement the following method OR the deprecated method at the bottom
/**
@@ -126,6 +134,27 @@ withDownloadIdentifier:(id)downloadIdentifier;
@end
@protocol ASAnimatedImageProtocol <NSObject>
@property (nonatomic, strong, readwrite) void (^coverImageReadyCallback)(UIImage *coverImage);
@required
@property (nonatomic, readonly) UIImage *coverImage;
@property (nonatomic, readonly) BOOL coverImageReady;
@property (nonatomic, readonly) CFTimeInterval totalDuration;
@property (nonatomic, readonly) NSUInteger frameInterval;
@property (nonatomic, readonly) size_t loopCount;
@property (nonatomic, readonly) size_t frameCount;
@property (nonatomic, readonly) BOOL playbackReady;
@property (nonatomic, strong, readwrite) dispatch_block_t playbackReadyCallback;
- (CGImageRef)imageAtIndex:(NSUInteger)index;
- (CFTimeInterval)durationAtIndex:(NSUInteger)index;
- (void)clearAnimatedImageCache;
@end
@protocol ASImageDownloaderProtocolDeprecated <ASImageDownloaderProtocol>
@optional