Skip to content

Commit

Permalink
Fix deprecated RCTImageLoader.h import (#1142)
Browse files Browse the repository at this point in the history
  • Loading branch information
filipemerker authored and ivpusic committed May 1, 2020
1 parent 90aad3e commit 8168b7d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 8 additions & 2 deletions ios/src/ImageCropPicker.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,16 @@

#if __has_include(<React/RCTBridgeModule.h>)
#import <React/RCTBridgeModule.h>
#import <React/RCTImageLoader.h>
#import <React/RCTImageURLLoader.h>
#import <React/RCTImageShadowView.h>
#import <React/RCTImageView.h>
#import <React/RCTImageLoaderProtocol.h>
#else
#import "RCTBridgeModule.h"
#import "RCTImageLoader.h"
#import "RCTImageURLLoader.h"
#import "RCTImageShadowView.h"
#import "RCTImageView.h"
#import "RCTImageLoaderProtocol.h"
#endif

#if __has_include("QBImagePicker.h")
Expand Down
2 changes: 1 addition & 1 deletion ios/src/ImageCropPicker.m
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ - (BOOL)cleanTmpDirectory {

NSString *path = [options objectForKey:@"path"];

[self.bridge.imageLoader loadImageWithURLRequest:[RCTConvert NSURLRequest:path] callback:^(NSError *error, UIImage *image) {
[[self.bridge moduleForName:@"ImageLoader" lazilyLoadIfNecessary:YES] loadImageWithURLRequest:[RCTConvert NSURLRequest:path] callback:^(NSError *error, UIImage *image) {
if (error) {
self.reject(ERROR_CROPPER_IMAGE_NOT_FOUND_KEY, ERROR_CROPPER_IMAGE_NOT_FOUND_MSG, nil);
} else {
Expand Down

0 comments on commit 8168b7d

Please sign in to comment.