Skip to content

Commit

Permalink
v3.7.1 - 批量缓存接口增加结果回调
Browse files Browse the repository at this point in the history
  • Loading branch information
CoderZhuXH committed Oct 11, 2017
1 parent 3bf4702 commit 3618668
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ configuration.customSkipView = [self customSkipView];
@param urlArray image URL Array
@param completedBlock 回调结果为一个字典数组,url:图片的url字符串,result:0表示该图片下载缓存失败,1表示该图片下载并缓存完成或本地缓存中已有该图片
*/
+(void)downLoadImageAndCacheWithURLArray:(nonnull NSArray <NSURL *> * )urlArray completed:(nullable XHLaunchAdBatchDownLoadCompletedBlock)completedBlock;
+(void)downLoadImageAndCacheWithURLArray:(nonnull NSArray <NSURL *> * )urlArray completed:(nullable XHLaunchAdBatchDownLoadAndCacheCompletedBlock)completedBlock;

/**
* 批量下载并缓存视频(异步) - 已缓存的视频不会再次下载缓存
Expand All @@ -418,7 +418,7 @@ configuration.customSkipView = [self customSkipView];
@param urlArray 视频URL Array
@param completedBlock 回调结果为一个字典数组,url:视频的url字符串,result:0表示该视频下载缓存失败,1表示该视频下载并缓存完成或本地缓存中已有该视频
*/
+(void)downLoadVideoAndCacheWithURLArray:(nonnull NSArray <NSURL *> * )urlArray completed:(nullable XHLaunchAdBatchDownLoadCompletedBlock)completedBlock;
+(void)downLoadVideoAndCacheWithURLArray:(nonnull NSArray <NSURL *> * )urlArray completed:(nullable XHLaunchAdBatchDownLoadAndCacheCompletedBlock)completedBlock;

```

Expand Down
6 changes: 3 additions & 3 deletions XHLaunchAd/XHLaunchAd/XHLaunchAd.h
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ NS_ASSUME_NONNULL_BEGIN
@param urlArray image URL Array
@param completedBlock 回调结果为一个字典数组,url:图片的url字符串,result:0表示该图片下载缓存失败,1表示该图片下载并缓存完成或本地缓存中已有该图片
*/
+(void)downLoadImageAndCacheWithURLArray:(nonnull NSArray <NSURL *> * )urlArray completed:(nullable XHLaunchAdBatchDownLoadCompletedBlock)completedBlock;
+(void)downLoadImageAndCacheWithURLArray:(nonnull NSArray <NSURL *> * )urlArray completed:(nullable XHLaunchAdBatchDownLoadAndCacheCompletedBlock)completedBlock;

/**
* 批量下载并缓存视频(异步) - 已缓存的视频不会再次下载缓存
Expand All @@ -173,9 +173,9 @@ NS_ASSUME_NONNULL_BEGIN
@param urlArray 视频URL Array
@param completedBlock 回调结果为一个字典数组,url:视频的url字符串,result:0表示该视频下载缓存失败,1表示该视频下载并缓存完成或本地缓存中已有该视频
*/
+(void)downLoadVideoAndCacheWithURLArray:(nonnull NSArray <NSURL *> * )urlArray completed:(nullable XHLaunchAdBatchDownLoadCompletedBlock)completedBlock;
+(void)downLoadVideoAndCacheWithURLArray:(nonnull NSArray <NSURL *> * )urlArray completed:(nullable XHLaunchAdBatchDownLoadAndCacheCompletedBlock)completedBlock;

#pragma mark - ction
#pragma mark - Action
/**
* 跳过按钮事件
*/
Expand Down
4 changes: 2 additions & 2 deletions XHLaunchAd/XHLaunchAd/XHLaunchAd.m
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ +(void)downLoadImageAndCacheWithURLArray:(NSArray <NSURL *> * )urlArray
{
[self downLoadImageAndCacheWithURLArray:urlArray completed:nil];
}
+ (void)downLoadImageAndCacheWithURLArray:(nonnull NSArray <NSURL *> * )urlArray completed:(nullable XHLaunchAdBatchDownLoadCompletedBlock)completedBlock
+ (void)downLoadImageAndCacheWithURLArray:(nonnull NSArray <NSURL *> * )urlArray completed:(nullable XHLaunchAdBatchDownLoadAndCacheCompletedBlock)completedBlock
{
if(urlArray.count==0) return;
[[XHLaunchAdDownloader sharedDownloader] downLoadImageAndCacheWithURLArray:urlArray completed:completedBlock];
Expand All @@ -82,7 +82,7 @@ +(void)downLoadVideoAndCacheWithURLArray:(NSArray <NSURL *> * )urlArray
{
[self downLoadVideoAndCacheWithURLArray:urlArray completed:nil];
}
+(void)downLoadVideoAndCacheWithURLArray:(nonnull NSArray <NSURL *> * )urlArray completed:(nullable XHLaunchAdBatchDownLoadCompletedBlock)completedBlock
+(void)downLoadVideoAndCacheWithURLArray:(nonnull NSArray <NSURL *> * )urlArray completed:(nullable XHLaunchAdBatchDownLoadAndCacheCompletedBlock)completedBlock
{
if(urlArray.count==0) return;
[[XHLaunchAdDownloader sharedDownloader] downLoadVideoAndCacheWithURLArray:urlArray completed:completedBlock];
Expand Down
6 changes: 3 additions & 3 deletions XHLaunchAd/XHLaunchAd/XHLaunchAdDownloader.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ typedef void(^XHLaunchAdDownloadImageCompletedBlock)(UIImage *_Nullable image, N

typedef void(^XHLaunchAdDownloadVideoCompletedBlock)(NSURL * _Nullable location, NSError * _Nullable error);

typedef void(^XHLaunchAdBatchDownLoadCompletedBlock) (NSArray * _Nonnull completedArray);
typedef void(^XHLaunchAdBatchDownLoadAndCacheCompletedBlock) (NSArray * _Nonnull completedArray);


@protocol XHLaunchAdDownloadDelegate <NSObject>
Expand Down Expand Up @@ -47,12 +47,12 @@ typedef void(^XHLaunchAdBatchDownLoadCompletedBlock) (NSArray * _Nonnull complet
- (void)downloadImageWithURL:(nonnull NSURL *)url progress:(nullable XHLaunchAdDownloadProgressBlock)progressBlock completed:(nullable XHLaunchAdDownloadImageCompletedBlock)completedBlock;

- (void)downLoadImageAndCacheWithURLArray:(nonnull NSArray <NSURL *> * )urlArray;
- (void)downLoadImageAndCacheWithURLArray:(nonnull NSArray <NSURL *> * )urlArray completed:(nullable XHLaunchAdBatchDownLoadCompletedBlock)completedBlock;
- (void)downLoadImageAndCacheWithURLArray:(nonnull NSArray <NSURL *> * )urlArray completed:(nullable XHLaunchAdBatchDownLoadAndCacheCompletedBlock)completedBlock;

- (void)downloadVideoWithURL:(nonnull NSURL *)url progress:(nullable XHLaunchAdDownloadProgressBlock)progressBlock completed:(nullable XHLaunchAdDownloadVideoCompletedBlock)completedBlock;

- (void)downLoadVideoAndCacheWithURLArray:(nonnull NSArray <NSURL *> * )urlArray;
- (void)downLoadVideoAndCacheWithURLArray:(nonnull NSArray <NSURL *> * )urlArray completed:(nullable XHLaunchAdBatchDownLoadCompletedBlock)completedBlock;
- (void)downLoadVideoAndCacheWithURLArray:(nonnull NSArray <NSURL *> * )urlArray completed:(nullable XHLaunchAdBatchDownLoadAndCacheCompletedBlock)completedBlock;

@end

4 changes: 2 additions & 2 deletions XHLaunchAd/XHLaunchAd/XHLaunchAdDownloader.m
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ -(void)downLoadImageAndCacheWithURLArray:(NSArray<NSURL *> *)urlArray
{
[self downLoadImageAndCacheWithURLArray:urlArray completed:nil];
}
- (void)downLoadImageAndCacheWithURLArray:(nonnull NSArray <NSURL *> * )urlArray completed:(nullable XHLaunchAdBatchDownLoadCompletedBlock)completedBlock
- (void)downLoadImageAndCacheWithURLArray:(nonnull NSArray <NSURL *> * )urlArray completed:(nullable XHLaunchAdBatchDownLoadAndCacheCompletedBlock)completedBlock
{
if(urlArray.count==0) return;
__block NSMutableArray * resultArray = [[NSMutableArray alloc] init];
Expand Down Expand Up @@ -335,7 +335,7 @@ - (void)downLoadVideoAndCacheWithURLArray:(nonnull NSArray <NSURL *> * )urlArray
{
[self downLoadVideoAndCacheWithURLArray:urlArray completed:nil];
}
- (void)downLoadVideoAndCacheWithURLArray:(nonnull NSArray <NSURL *> * )urlArray completed:(nullable XHLaunchAdBatchDownLoadCompletedBlock)completedBlock
- (void)downLoadVideoAndCacheWithURLArray:(nonnull NSArray <NSURL *> * )urlArray completed:(nullable XHLaunchAdBatchDownLoadAndCacheCompletedBlock)completedBlock
{
if(urlArray.count==0) return;
__block NSMutableArray * resultArray = [[NSMutableArray alloc] init];
Expand Down
Binary file not shown.

0 comments on commit 3618668

Please sign in to comment.