SDWebImageDownloaderDecryptor

@protocol SDWebImageDownloaderDecryptor <NSObject>

This is the protocol for downloader decryptor. Which decrypt the original encrypted data before decoding. Note progressive decoding is not compatible for decryptor. We can use a block to specify the downloader decryptor. But Using protocol can make this extensible, and allow Swift user to use it easily instead of using @convention(block) to store a block into context options.

  • Decrypt the original download data and return a new data. You can use this to decrypt the data using your preferred algorithm.

    Note

    If nil is returned, the image download will be marked as failed with error SDWebImageErrorBadImageData

    Declaration

    Objective-C

    - (nullable NSData *)decryptedDataWithData:(nonnull NSData *)data
                                      response:(nullable NSURLResponse *)response;

    Swift

    func decryptedData(with data: Data, response: URLResponse?) -> Data?

    Parameters

    data

    The original download data

    response

    The URL response for data. If you modify the original URL response via response modifier, the modified version will be here. This arg is nullable.