Commit efd15353 authored by yuzheng's avatar yuzheng

新增isFetchingMedia标志位,在获取大图时相册的变化忽略掉

parent d6f7d36c
......@@ -67,8 +67,8 @@
/// Default is 600px / 默认600像素宽
@property (nonatomic, assign) CGFloat photoPreviewMaxWidth;
/// Default is 15, While fetching photo, HUD will dismiss automatic if timeout;
/// 超时时间,默认为15秒,当取图片时间超过15秒还没有取成功时,会自动dismiss HUD;
/// Default is 30, While fetching photo, HUD will dismiss automatic if timeout;
/// 超时时间,默认为30秒,当取图片时间超过30秒还没有取成功时,会自动dismiss HUD;
@property (nonatomic, assign) NSInteger timeout;
/// Default is YES, if set NO, the original photo button will hide. user can't picking original photo.
......
......@@ -268,7 +268,7 @@
- (void)configDefaultSetting {
self.autoSelectCurrentWhenDone = YES;
self.timeout = 15;
self.timeout = 30;
self.photoWidth = 828.0;
self.photoPreviewMaxWidth = 600;
self.naviTitleColor = [UIColor whiteColor];
......
......@@ -45,6 +45,7 @@
@property (strong, nonatomic) CLLocation *location;
@property (nonatomic, strong) NSOperationQueue *operationQueue;
@property (nonatomic, assign) BOOL isSavingMedia;
@property (nonatomic, assign) BOOL isFetchingMedia;
@end
static CGSize AssetGridThumbnailSize;
......@@ -440,6 +441,7 @@ static CGFloat itemMargin = 5;
[tzImagePickerVc showProgressHUD];
_doneButton.enabled = NO;
self.isFetchingMedia = YES;
NSMutableArray *assets = [NSMutableArray array];
NSMutableArray *photos;
NSMutableArray *infoArr;
......@@ -502,6 +504,7 @@ static CGFloat itemMargin = 5;
TZImagePickerController *tzImagePickerVc = (TZImagePickerController *)self.navigationController;
[tzImagePickerVc hideProgressHUD];
_doneButton.enabled = YES;
self.isFetchingMedia = NO;
if (tzImagePickerVc.autoDismiss) {
[self.navigationController dismissViewControllerAnimated:YES completion:^{
......@@ -963,7 +966,7 @@ static CGFloat itemMargin = 5;
#pragma mark - PHPhotoLibraryChangeObserver
- (void)photoLibraryDidChange:(PHChange *)changeInstance {
if (self.isSavingMedia) {
if (self.isSavingMedia || self.isFetchingMedia) {
return;
}
dispatch_async(dispatch_get_main_queue(), ^{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment