Commit efd15353 authored by yuzheng's avatar yuzheng

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

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