SDWebImageCacheKeyFilter

@protocol SDWebImageCacheKeyFilter <NSObject>

This is the protocol for cache key filter. We can use a block to specify the cache key filter. 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.

  • Declaration

    Objective-C

    - (nullable NSString *)cacheKeyForURL:(nonnull NSURL *)url;

    Swift

    func cacheKey(for url: URL) -> String?