AnyModifier
public struct AnyModifier : ImageDownloadRequestModifier
A wrapper for creating an ImageDownloadRequestModifier
easier.
This type conforms to ImageDownloadRequestModifier
and wraps an image modify block.
-
For
ImageDownloadRequestModifier
conformation.Declaration
Swift
public func modified(for request: URLRequest) -> URLRequest?
-
Creates a value of
ImageDownloadRequestModifier
which runsmodify
block.Declaration
Swift
public init(modify: @escaping (URLRequest) -> URLRequest?)
Parameters
modify
The request modifying block runs when a request modifying task comes. The return
URLRequest?
value of this block will be used as the image download request. Ifnil
returned, aKingfisherError.requestError
with.emptyRequest
as its reason will occur.