We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi! 👋
Firstly, thanks for your work on this project! 🙂
Today I used patch-package to patch @merryjs/[email protected] for the project I'm working on.
@merryjs/[email protected]
Here is the diff that solved my problem:
diff --git a/node_modules/@merryjs/photo-viewer/MerryPhotoViewer.podspec b/node_modules/@merryjs/photo-viewer/MerryPhotoViewer.podspec index 9e88af7..27413c5 100644 --- a/node_modules/@merryjs/photo-viewer/MerryPhotoViewer.podspec +++ b/node_modules/@merryjs/photo-viewer/MerryPhotoViewer.podspec @@ -16,4 +16,5 @@ Pod::Spec.new do |s| s.dependency "React" s.dependency "NYTPhotoViewer", '2.0.0' + s.dependency 'SDWebImage' end diff --git a/node_modules/@merryjs/photo-viewer/ios/MerryPhotoView.m b/node_modules/@merryjs/photo-viewer/ios/MerryPhotoView.m index af8ea83..a3266f6 100644 --- a/node_modules/@merryjs/photo-viewer/ios/MerryPhotoView.m +++ b/node_modules/@merryjs/photo-viewer/ios/MerryPhotoView.m @@ -2,6 +2,7 @@ #import "MerryPhotoView.h" #import <React/RCTImageLoader.h> #import <Foundation/Foundation.h> +#import <SDWebImage/SDWebImage.h> @implementation MerryPhotoView { @@ -159,26 +160,16 @@ - (void)updatePhotoAtIndex:(NYTPhotosViewController*)photosViewController MerryPhoto* currentPhoto = [self.dataSource.photos objectAtIndex:current]; MerryPhotoData* d = self.reactPhotos[current]; - [[_bridge moduleForClass:[RCTImageLoader class]] loadImageWithURLRequest:d.source.request - size:d.source.size - scale:d.source.scale - clipped:YES - resizeMode:RCTResizeModeStretch - progressBlock:^(int64_t progress, int64_t total) { - // NSLog(@"%lld %lld", progress, total); + [[SDWebImageManager sharedManager] loadImageWithURL:d.source.request.URL options:0 progress:^(NSInteger receivedSize, NSInteger expectedSize, NSURL * _Nullable targetURL) { + // ignore + } completed:^(UIImage * _Nullable image, NSData * _Nullable data, NSError * _Nullable error, SDImageCacheType cacheType, BOOL finished, NSURL * _Nullable imageURL) { + if (image) { + dispatch_async(dispatch_get_main_queue(), ^{ + currentPhoto.image = image; + [photosViewController updatePhoto:currentPhoto]; + }); } - partialLoadBlock:nil - completionBlock:^(NSError* error, UIImage* image) { - if (image) { - dispatch_async(dispatch_get_main_queue(), ^{ - - currentPhoto.image = image; - - [photosViewController updatePhoto:currentPhoto]; - - }); - } - }]; + }]; } #pragma mark - NYTPhotosViewControllerDelegate
This issue body was partially generated by patch-package.
The text was updated successfully, but these errors were encountered:
@zhigang1992 Nice try. 👍
Sorry, something went wrong.
No branches or pull requests
Hi! 👋
Firstly, thanks for your work on this project! 🙂
Today I used patch-package to patch
@merryjs/[email protected]
for the project I'm working on.Here is the diff that solved my problem:
This issue body was partially generated by patch-package.
The text was updated successfully, but these errors were encountered: