mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
bae5aea074
Summary: Changelog: [Internal] For image loading, the loader may need to inspect the imageView itself, so let's pass its reactTag. This only works pre-Fabric. Reviewed By: sammy-SC Differential Revision: D18522073 fbshipit-source-id: 400fc7e04b8d7852f6ecef941dd446fbff423c88
40 lines
1.4 KiB
Objective-C
40 lines
1.4 KiB
Objective-C
/*
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|
|
|
|
#import <React/RCTImageURLLoader.h>
|
|
|
|
namespace facebook {
|
|
namespace react {
|
|
|
|
struct ImageURLLoaderAttribution {
|
|
int32_t nativeViewTag = 0;
|
|
int32_t surfaceId = 0;
|
|
};
|
|
|
|
} // namespace react
|
|
} // namespace facebook
|
|
|
|
/**
|
|
* Same as the RCTImageURLLoader interface, but allows passing in optional `attribution` information.
|
|
* This is useful for per-app logging and other instrumentation.
|
|
*/
|
|
@protocol RCTImageURLLoaderWithAttribution <RCTImageURLLoader>
|
|
|
|
/**
|
|
* Same as the RCTImageURLLoader variant above, but allows optional `attribution` information.
|
|
*/
|
|
- (RCTImageLoaderCancellationBlock)loadImageForURL:(NSURL *)imageURL
|
|
size:(CGSize)size
|
|
scale:(CGFloat)scale
|
|
resizeMode:(RCTResizeMode)resizeMode
|
|
attribution:(const facebook::react::ImageURLLoaderAttribution &)attribution
|
|
progressHandler:(RCTImageLoaderProgressBlock)progressHandler
|
|
partialLoadHandler:(RCTImageLoaderPartialLoadBlock)partialLoadHandler
|
|
completionHandler:(RCTImageLoaderCompletionBlock)completionHandler;
|
|
|
|
@end
|