Skip to content

Commit

Permalink
fix(ios): deprecation of RCTImageLoader fixes #1141
Browse files Browse the repository at this point in the history
  • Loading branch information
msand committed Oct 19, 2019
1 parent 9a3dc4e commit 5452144
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions ios/Elements/RNSVGImage.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@
#import "RNSVGImage.h"
#import "RCTConvert+RNSVG.h"
#import <React/RCTImageSource.h>
#import <React/RCTImageLoader.h>
#import <React/RCTImageURLLoader.h>
#import <React/RCTImageShadowView.h>
#import <React/RCTImageView.h>
#import <React/RCTImageLoaderProtocol.h>
#import <React/RCTLog.h>
#import "RNSVGViewBox.h"

Expand Down Expand Up @@ -40,7 +43,7 @@ - (void)setSrc:(id)src
_reloadImageCancellationBlock = nil;
}

_reloadImageCancellationBlock = [self.bridge.imageLoader loadImageWithURLRequest:[RCTConvert NSURLRequest:src] callback:^(NSError *error, UIImage *image) {
_reloadImageCancellationBlock = [[self.bridge moduleForName:@"ImageLoader"] loadImageWithURLRequest:[RCTConvert NSURLRequest:src] callback:^(NSError *error, UIImage *image) {
dispatch_async(dispatch_get_main_queue(), ^{
self->_image = CGImageRetain(image.CGImage);
self->_imageSize = CGSizeMake(CGImageGetWidth(self->_image), CGImageGetHeight(self->_image));
Expand Down

0 comments on commit 5452144

Please sign in to comment.