Kingfisher Documentation

Structure Any​Redirect​Handler

public struct AnyRedirectHandler: ImageDownloadRedirectHandler  

A wrapper for creating an ImageDownloadRedirectHandler easier. This type conforms to ImageDownloadRedirectHandler and wraps a redirect request modify block.

%101 AnyRedirectHandler AnyRedirectHandler ImageDownloadRedirectHandler ImageDownloadRedirectHandler AnyRedirectHandler->ImageDownloadRedirectHandler

Conforms To

ImageDownloadRedirectHandler

Represents and wraps a method for modifying request during an image download request redirection.

Initializers

init(handle:​)

public init(handle: @escaping (SessionDataTask, HTTPURLResponse, URLRequest, @escaping (URLRequest?) -> Void) -> Void)  

Creates a value of ImageDownloadRedirectHandler which runs modify block.

Parameters

modify

The request modifying block runs when a request modifying task comes.

Methods

handle​HTTPRedirection(for:​response:​new​Request:​completion​Handler:​)

public func handleHTTPRedirection(
        for task: SessionDataTask,
        response: HTTPURLResponse,
        newRequest: URLRequest,
        completionHandler: @escaping (URLRequest?) -> Void)