Skip to content

Commit

Permalink
Create protocol for delegate for image cacheing
Browse files Browse the repository at this point in the history
Reviewed By: donyu

Differential Revision: D3581390

fbshipit-source-id: 869437dd05db614f8191eab69723c4742df0637b
  • Loading branch information
Maria Mateescu authored and Facebook Github Bot 6 committed Jul 28, 2016
1 parent 75ecaf4 commit f12d0a2
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions Libraries/Image/RCTImageLoader.h
Original file line number Diff line number Diff line change
Expand Up @@ -198,3 +198,25 @@ typedef dispatch_block_t RCTImageLoaderCancellationBlock;
- (float)decoderPriority;

@end


/**
* Provides an interface to use for providing a image caching strategy.
*/

@protocol RCTImageCacheDelegate <NSObject>

- (UIImage *)imageForUrl:(NSString *)url
size:(CGSize)size
scale:(CGFloat)scale
resizeMode:(RCTResizeMode)resizeMode
responseDate:(NSString *)responseDate;

- (void)addImageToCache:(UIImage *)image
URL:(NSString *)url
size:(CGSize)size
scale:(CGFloat)scale
resizeMode:(RCTResizeMode)resizeMode
responseDate:(NSString *)responseDate;

@end

0 comments on commit f12d0a2

Please sign in to comment.