图片批量上传 -串行异步
作者:
Markcf | 来源:发表于
2017-04-13 16:46 被阅读0次- (void) uploadMultiplePicturesWith:(NSArray<UIImage *> *) pictures
IndexArr:(NSMutableArray *) indexArr //传空数组 ,用于记录上传成功图片账张数
completion :(void(^)(BOOL isSuccess)) completion{
if (!indexArr) {
indexArr = [NSMutableArray array];
}
if ([indexArr count] >= [pictures count]) {
completion(YES);
return;
}
[self upLoadSigleImage:pictures[indexArr.count] completion:^(BOOL isSuccess) {
if (isSuccess) {
[indexArr addObject:@(1)];
[self uploadMultiplePicturesWith:pictures IndexArr:indexArr completion:completion];
}else{
completion(NO);
return;
}
}];
}
本文标题:图片批量上传 -串行异步
本文链接:https://www.haomeiwen.com/subject/ktobattx.html
网友评论