diff --git a/MWPhotoBrowser.podspec b/MWPhotoBrowser.podspec index 2b8d0e563..030e6f6d1 100644 --- a/MWPhotoBrowser.podspec +++ b/MWPhotoBrowser.podspec @@ -27,7 +27,7 @@ Pod::Spec.new do |s| :git => 'https://github.com/mwaterfall/MWPhotoBrowser.git', :tag => '2.1.2' } - s.platform = :ios, '7.0' + s.platform = :ios, '15.0' s.source_files = 'Pod/Classes/**/*' s.resource_bundles = { 'MWPhotoBrowser' => ['Pod/Assets/*.png'] @@ -43,6 +43,6 @@ Pod::Spec.new do |s| # 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' end diff --git a/Pod/Classes/MWPhoto.m b/Pod/Classes/MWPhoto.m index 6b1f697cc..b901ee903 100644 --- a/Pod/Classes/MWPhoto.m +++ b/Pod/Classes/MWPhoto.m @@ -6,7 +6,6 @@ // Copyright 2010 d3i. All rights reserved. // -#import #import #import #import @@ -212,27 +211,25 @@ - (void)performLoadUnderlyingImageAndNotify { - (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]; - }); - }]; + [manager loadImageWithURL: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, SDImageCacheType cacheType, BOOL finished, NSURL * _Nullable imageURL) { + 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;