Kingfisher Documentation

Protocol Retry​Strategy

public protocol RetryStrategy  

Defines a retry strategy can be applied to a .retryStrategy option.

%85 RetryStrategy RetryStrategy DelayRetryStrategy DelayRetryStrategy DelayRetryStrategy->RetryStrategy

Types Conforming to Retry​Strategy


A retry strategy that guides Kingfisher to retry when a .responseError happens, with a specified max retry count and a certain interval mechanism.



func retry(context: RetryContext, retryHandler: @escaping (RetryDecision) -> Void) 

Kingfisher calls this method if an error happens during the image retrieving process from a KingfisherManager. You implement this method to provide necessary logic based on the context parameter. Then you need to call retryHandler to pass the retry decision back to Kingfisher.


context Retry​Context

The retry context containing information of current retry attempt.

retry​Handler @escaping (Retry​Decision) -> Void

A block you need to call with a decision of whether the retry should happen or not.