public protocol ImageDownloadRequestModifier: AsyncImageDownloadRequestModifier
Represents and wraps a method for modifying request before an image download request starts.
Represents and wraps a method for modifying request before an image download request starts in an asynchronous way.
Types Conforming to
A wrapper for creating an
ImageDownloadRequestModifiereasier. This type conforms to
ImageDownloadRequestModifierand wraps an image modify block.
public func modified(for request: URLRequest, reportModified: @escaping (URLRequest?) -> Void)
func modified(for request: URLRequest) -> URLRequest?
This method will be called just before the
request being sent.
This is the last chance you can modify the image download request. You can modify the request for some
customizing purpose, such as adding auth token to the header, do basic HTTP auth or something like url mapping.
Usually, you pass an
ImageDownloadRequestModifier as the associated value of
KingfisherOptionsInfoItem.requestModifier and use it as the
options parameter in related methods.
If you do nothing with the input
request and return it as is, a downloading process will start with it.
The input request contains necessary information like
A modified version of request, which you wish to use for downloading an image. If
nil returned, a
.emptyRequest as its reason will occur.