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 runs modify 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. If nil returned, a KingfisherError.requestError with .emptyRequest as its reason will occur.