Inherits from NSObject
Declared in RCTImageDownloader.h

Tasks

  • + sharedInstance
  • – downloadDataForURL:progressBlock:block:

    Downloads a block of raw data and returns it. Note that the callback block will not be executed on the same thread you called the method from, nor on the main thread. Returns a token that can be used to cancel the download.

  • – downloadImageForURL:size:scale:resizeMode:backgroundColor:progressBlock:block:

    Downloads an image and decompresses it a the size specified. The compressed image will be cached in memory and to disk. Note that the callback block will not be executed on the same thread you called the method from, nor on the main thread. Returns a token that can be used to cancel the download.

  • – cancelDownload:

    Cancel an in-flight download. If multiple requets have been made for the same image, only the request that relates to the token passed will be cancelled.

Class Methods

sharedInstance

+ (RCTImageDownloader *)sharedInstance

Instance Methods

cancelDownload:

- (void)cancelDownload:(RCTImageDownloadCancellationBlock)downloadToken
Discussion

Cancel an in-flight download. If multiple requets have been made for the same image, only the request that relates to the token passed will be cancelled.

Declared In

RCTImageDownloader.h

downloadDataForURL:progressBlock:block:

- (RCTImageDownloadCancellationBlock)downloadDataForURL:(NSURL *)url progressBlock:(RCTDataProgressBlock)progressBlock block:(RCTDataDownloadBlock)block
Discussion

Downloads a block of raw data and returns it. Note that the callback block will not be executed on the same thread you called the method from, nor on the main thread. Returns a token that can be used to cancel the download.

Declared In

RCTImageDownloader.h

downloadImageForURL:size:scale:resizeMode:backgroundColor:progressBlock:block:

- (RCTImageDownloadCancellationBlock)downloadImageForURL:(NSURL *)url size:(CGSize)size scale:(CGFloat)scale resizeMode:(UIViewContentMode)resizeMode backgroundColor:(UIColor *)backgroundColor progressBlock:(RCTDataProgressBlock)progressBlock block:(RCTImageDownloadBlock)block
Discussion

Downloads an image and decompresses it a the size specified. The compressed image will be cached in memory and to disk. Note that the callback block will not be executed on the same thread you called the method from, nor on the main thread. Returns a token that can be used to cancel the download.

Declared In

RCTImageDownloader.h