KingfisherManager
public class KingfisherManager
Main manager class of Kingfisher. It connects Kingfisher downloader and cache. You can use this class to retrieve an image via a specified URL from web or cache.
-
Shared manager used by the extensions across Kingfisher.
Declaration
Swift
public static let shared = KingfisherManager() -
Cache used by this manager
Declaration
Swift
public var cache: ImageCache -
Downloader used by this manager
Declaration
Swift
public var downloader: ImageDownloader -
Default options used by the manager. This option will be used in Kingfisher manager related methods, including all image view and button extension methods. You can also passing the options per image by sending an
optionsparameter to Kingfisher’s APIs, the per image option will overwrite the default ones if exist.Declaration
Swift
public var defaultOptions = KingfisherEmptyOptionsInfo -
Get an image with resource. If KingfisherOptions.None is used as
options, Kingfisher will seek the image in memory and disk first. If not found, it will download the image atresource.downloadURLand cache it withresource.cacheKey. These default behaviors could be adjusted by passing different options. SeeKingfisherOptionsfor more.Declaration
Swift
public func retrieveImage(with resource: Resource, options: KingfisherOptionsInfo?, progressBlock: DownloadProgressBlock?, completionHandler: CompletionHandler?) -> RetrieveImageTaskParameters
resourceResource object contains information such as
cacheKeyanddownloadURL.optionsA dictionary could control some behaviors. See
KingfisherOptionsInfofor more.progressBlockCalled every time downloaded data changed. This could be used as a progress UI.
completionHandlerCalled when the whole retrieving process finished.
Return Value
A
RetrieveImageTasktask object. You can use this object to cancel the task.
View on GitHub
Install in Dash
KingfisherManager Class Reference