diff --git a/Example/MWPhotoBrowser.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Example/MWPhotoBrowser.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 000000000..18d981003 --- /dev/null +++ b/Example/MWPhotoBrowser.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/MWPhotoBrowser.podspec b/MWPhotoBrowser.podspec index 2b8d0e563..0ce14762c 100644 --- a/MWPhotoBrowser.podspec +++ b/MWPhotoBrowser.podspec @@ -19,15 +19,15 @@ Pod::Spec.new do |s| 'https://raw.github.com/mwaterfall/MWPhotoBrowser/master/Screenshots/MWPhotoBrowser6.png' ] - s.homepage = 'https://github.com/mwaterfall/MWPhotoBrowser' + s.homepage = 'https://github.com/ZMAsd/MWPhotoBrowser' s.author = { 'Michael Waterfall' => 'michaelwaterfall@gmail.com' } s.social_media_url = 'https://twitter.com/mwaterfall' s.source = { - :git => 'https://github.com/mwaterfall/MWPhotoBrowser.git', + :git => 'https://github.com/ZMAsd/MWPhotoBrowser.git', :tag => '2.1.2' } - s.platform = :ios, '7.0' + s.platform = :ios, '10.0' s.source_files = 'Pod/Classes/**/*' s.resource_bundles = { 'MWPhotoBrowser' => ['Pod/Assets/*.png'] @@ -37,12 +37,12 @@ Pod::Spec.new do |s| s.frameworks = 'ImageIO', 'QuartzCore', 'AssetsLibrary', 'MediaPlayer' s.weak_frameworks = 'Photos' - s.dependency 'MBProgressHUD', '~> 0.9' + s.dependency 'MBProgressHUD', '~> 1.2.0' s.dependency 'DACircularProgress', '~> 2.3' # SDWebImage # 3.7.2 contains bugs downloading local files # https://github.com/rs/SDWebImage/issues/1109 - s.dependency 'SDWebImage', '~> 3.7', '!= 3.7.2' + s.dependency 'SDWebImage', '~> 5.12.1' end diff --git a/Pod/Classes/MWPhoto.m b/Pod/Classes/MWPhoto.m index 6b1f697cc..eb70f19d3 100644 --- a/Pod/Classes/MWPhoto.m +++ b/Pod/Classes/MWPhoto.m @@ -9,6 +9,7 @@ #import #import #import +#import #import #import "MWPhoto.h" #import "MWPhotoBrowser.h" @@ -211,28 +212,25 @@ - (void)performLoadUnderlyingImageAndNotify { // Load from local file - (void)_performLoadUnderlyingImageAndNotifyWithWebURL:(NSURL *)url { @try { - SDWebImageManager *manager = [SDWebImageManager sharedManager]; - _webImageOperation = [manager downloadImageWithURL:url - options:0 - progress:^(NSInteger receivedSize, NSInteger expectedSize) { - if (expectedSize > 0) { - float progress = receivedSize / (float)expectedSize; - NSDictionary* dict = [NSDictionary dictionaryWithObjectsAndKeys: - [NSNumber numberWithFloat:progress], @"progress", - self, @"photo", nil]; - [[NSNotificationCenter defaultCenter] postNotificationName:MWPHOTO_PROGRESS_NOTIFICATION object:dict]; - } - } - completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, BOOL finished, NSURL *imageURL) { - if (error) { - MWLog(@"SDWebImage failed to download image: %@", error); - } - _webImageOperation = nil; - self.underlyingImage = image; - dispatch_async(dispatch_get_main_queue(), ^{ - [self imageLoadingComplete]; - }); - }]; + [[SDWebImageDownloader sharedDownloader] downloadImageWithURL:url options:0 progress:^(NSInteger receivedSize, NSInteger expectedSize, NSURL * _Nullable targetURL) { + if (expectedSize > 0) { + float progress = receivedSize / (float)expectedSize; + NSDictionary* dict = [NSDictionary dictionaryWithObjectsAndKeys: + [NSNumber numberWithFloat:progress], @"progress", + self, @"photo", nil]; + [[NSNotificationCenter defaultCenter] postNotificationName:MWPHOTO_PROGRESS_NOTIFICATION object:dict]; + } + } completed:^(UIImage * _Nullable image, NSData * _Nullable data, NSError * _Nullable error, BOOL finished) { + if (error) { + MWLog(@"SDWebImage failed to download image: %@", error); + } + _webImageOperation = nil; + self.underlyingImage = image; + dispatch_async(dispatch_get_main_queue(), ^{ + [self imageLoadingComplete]; + }); + + }]; } @catch (NSException *e) { MWLog(@"Photo from web: %@", e); _webImageOperation = nil;