Classes
- DiskStorage.Backend
-
Represents a storage back-end for the
DiskStorage
. The value is serialized to data and stored as file in the file system under a specified location. - ImageCache
-
Represents a hybrid caching system which is composed by a
MemoryStorage.Backend
and aDiskStorage.Backend
.ImageCache
is a high level abstract for storing an image as well as its data to memory and disk, and retrieving them back. - MemoryStorage.Backend
-
Represents a storage which stores a certain type of value in memory. It provides fast access, but limited storing size. The stored value type needs to conform to
CacheCostCalculable
, and itscacheCost
will be used to determine the cost of size for the cache item. - KF.Builder
-
A builder class to configure an image retrieving task and set it to a holder view or component.
- KingfisherManager
-
Main manager class of Kingfisher. It connects Kingfisher downloader and cache, to provide a set of convenience methods to use Kingfisher for tasks. You can use this class to retrieve an image via a specified URL from web or cache.
- GIFAnimatedImage
-
Represents the decoding for a GIF image. This class extracts frames from an
imageSource
, then hold the images for later use. - ImageDownloader
-
Represents a downloading manager for requesting the image with a URL from server.
- ImagePrefetcher
-
ImagePrefetcher
represents a downloading manager for requesting many images via URLs, then caching them. This is useful when you know a list of image resources and want to download them before showing. It also works with some Cocoa prefetching mechanism like table view or collection viewprefetchDataSource
, to start image downloading and caching before they display on screen. - RetryContext
-
Represents a retry context which could be used to determine the current retry status.
- SessionDataTask
-
Represents a session data task in
ImageDownloader
. It consists of an underlyingURLSessionDataTask
and an array ofTaskCallback
. MultipleTaskCallback
s could be added for a single downloading data task. - SessionDelegate
- KFImage.Context
- Delegate
-
A class that keeps a weakly reference for
self
when implementingonXXX
behaviors. Instead of remembering to keepself
as weak in a stored closure: - AnimatedImageView
-
Represents a subclass of
UIImageView
for displaying animated image. Different from showing animated image in a normalUIImageView
(which load all frames at one time),AnimatedImageView
only tries to load several frames (defined byframePreloadCount
) to reduce memory usage. It provides a tradeoff between memory usage and CPU time. If you have a memory issue when using a normal image view to load GIF data, you could give this class a try. - AnimatedImageView.Animator
-
An animator which used to drive the data behind
AnimatedImageView
.
Structures
- DefaultCacheSerializer
-
Represents a basic and default
CacheSerializer
used in Kingfisher disk cache system. It could serialize and deserialize images in PNG, JPEG and GIF format. For image other than these formats, a normalizedpngRepresentation
will be used. - DiskStorage.Config
-
Represents the config used in a
DiskStorage
. - FormatIndicatedCacheSerializer
-
FormatIndicatedCacheSerializer
lets you indicate an image format for serialized caches. - CacheStoreResult
-
Represents the caching operation result.
- MemoryStorage.Config
-
Represents the config used in a
MemoryStorage
. - AVAssetImageDataProvider
-
A data provider to provide thumbnail data from a given AVKit asset.
- LocalFileImageDataProvider
-
Represents an image data provider for loading from a local file URL on disk. Uses this type for adding a disk image to Kingfisher. Compared to loading it directly, you can get benefit of using Kingfisher's extension methods, as well as applying
ImageProcessor
s and storing the image toImageCache
of Kingfisher. - Base64ImageDataProvider
-
Represents an image data provider for loading image from a given Base64 encoded string.
- RawImageDataProvider
-
Represents an image data provider for a raw data object.
- ImageResource
-
ImageResource is a simple combination of
downloadURL
andcacheKey
. When passed to image view set methods, Kingfisher will try to download the target image from thedownloadURL
, and then store it with thecacheKey
as the key in cache. - KF.RedirectPayload
-
Represents the detail information when a task redirect happens. It is wrapping necessary information for a
ImageDownloadRedirectHandler
. See that protocol for more information. - KingfisherWrapper
-
Wrapper for Kingfisher compatible types. This type provides an extension point for convenience methods in Kingfisher.
- RetrieveImageResult
-
Represents the result of a Kingfisher retrieving image task.
- PropagationError
-
A struct that stores some related information of an
KingfisherError
. It provides some context information for a pure error so you can identify the error easier. - KingfisherParsedOptionsInfo
-
The parsed options info used across Kingfisher methods. Each property in this type corresponds a case member in
KingfisherOptionsInfoItem
. When aKingfisherOptionsInfo
sent to Kingfisher related methods, it will be parsed and converted to aKingfisherParsedOptionsInfo
first, and pass through the internal methods. - Filter
-
A wrapper struct for a
Transformer
of CIImage filters. AFilter
value could be used to create aCIImage
processor. - ImageCreatingOptions
-
Represents a set of image creating options used in Kingfisher.
- DefaultImageProcessor
-
The default processor. It converts the input data to a valid image. Images of .PNG, .JPEG and .GIF format are supported. If an image item is given as
.image
case,DefaultImageProcessor
will do nothing on it and return the associated image. - RectCorner
-
Represents the rect corner setting when processing a round corner image.
- BlendImageProcessor
-
Processor for adding an blend mode to images. Only CG-based images are supported.
- CompositingImageProcessor
-
Processor for adding an compositing operation to images. Only CG-based images are supported in macOS.
- RoundCornerImageProcessor
-
Processor for making round corner images. Only CG-based images are supported in macOS, if a non-CG image passed in, the processor will do nothing.
- Border
- BorderImageProcessor
- ResizingImageProcessor
-
Processor for resizing images. If you need to resize a data represented image to a smaller size, use
DownsamplingImageProcessor
instead, which is more efficient and uses less memory. - BlurImageProcessor
-
Processor for adding blur effect to images.
Accelerate.framework
is used underhood for a better performance. A simulated Gaussian blur with specified blur radius will be applied. - OverlayImageProcessor
-
Processor for adding an overlay to images. Only CG-based images are supported in macOS.
- TintImageProcessor
-
Processor for tint images with color. Only CG-based images are supported.
- ColorControlsProcessor
-
Processor for applying some color control to images. Only CG-based images are supported. watchOS is not supported.
- BlackWhiteProcessor
-
Processor for applying black and white effect to images. Only CG-based images are supported. watchOS is not supported.
- CroppingImageProcessor
-
Processor for cropping an image. Only CG-based images are supported. watchOS is not supported.
- DownsamplingImageProcessor
-
Processor for downsampling an image. Compared to
ResizingImageProcessor
, this processor does not render the images to resize. Instead, it downsamples the input data directly to an image. It is a more efficient thanResizingImageProcessor
. Prefer to useDownsamplingImageProcessor
as possible as you can than theResizingImageProcessor
. - ImageProgressive
- ImageLoadingResult
-
Represents a success result of an image downloading progress.
- DownloadTask
-
Represents a task of an image downloading process.
- AnyImageModifier
-
A wrapper for creating an
ImageModifier
easier. This type conforms toImageModifier
and wraps an image modify block. If theblock
throws an error, the original image will be used. - RenderingModeImageModifier
-
Modifier for setting the rendering mode of images.
- FlipsForRightToLeftLayoutDirectionImageModifier
-
Modifier for setting the
flipsForRightToLeftLayoutDirection
property of images. - AlignmentRectInsetsImageModifier
-
Modifier for setting the
alignmentRectInsets
property of images. - AnyRedirectHandler
-
A wrapper for creating an
ImageDownloadRedirectHandler
easier. This type conforms toImageDownloadRedirectHandler
and wraps a redirect request modify block. - AnyModifier
-
A wrapper for creating an
ImageDownloadRequestModifier
easier. This type conforms toImageDownloadRequestModifier
and wraps an image modify block. - DelayRetryStrategy
-
A retry strategy that guides Kingfisher to retry when a
.responseError
happens, with a specified max retry count and a certain interval mechanism. - KFAnimatedImage
- KFAnimatedImageViewRepresenter
-
A wrapped
UIViewRepresentable
ofAnimatedImageView
- KFImage
Enumerations
- DiskStorage
-
Represents a set of conception related to storage which stores a certain type of value in disk. This is a namespace for the disk storage types. A
Backend
with a certainConfig
will be used to describe the storage. See these composed types for more information. - CacheType
-
Cache type of a cached image.
- ImageCacheResult
-
Represents the getting image operation from the cache.
- MemoryStorage
-
Represents a set of conception related to storage which stores a certain type of value in memory. This is a namespace for the memory storage types. A
Backend
with a certainConfig
will be used to describe the storage. See these composed types for more information. - StorageExpiration
-
Represents the expiration strategy used in storage.
- ExpirationExtending
-
Represents the expiration extending strategy used in storage to after access.
- AVAssetImageDataProvider.AVAssetImageDataProviderError
-
The possible error might be caused by the
AVAssetImageDataProvider
. - Source
-
Represents an image setting source for Kingfisher methods.
- Source.Identifier
-
Represents the source task identifier when setting an image to a view with extension methods.
- KF
-
A helper type to create image setting tasks in a builder pattern. Use methods in this type to create a
KF.Builder
instance and configure image tasks there. - KingfisherError
-
Represents all the errors which can happen in Kingfisher framework. Kingfisher related methods always throw a
KingfisherError
or invoke the callback withKingfisherError
as its error type. To handle errors from Kingfisher, you switch over the error to get a reason catalog, then switch over the reason to know error detail. - KingfisherError.RequestErrorReason
-
Represents the error reason during networking request phase.
- KingfisherError.ResponseErrorReason
-
Represents the error reason during networking response phase.
- KingfisherError.CacheErrorReason
-
Represents the error reason during Kingfisher caching system.
- KingfisherError.ProcessorErrorReason
-
Represents the error reason during image processing phase.
- KingfisherError.ImageSettingErrorReason
-
Represents the error reason during image setting in a view related class.
- KingfisherOptionsInfoItem
-
Represents the available option items could be used in
KingfisherOptionsInfo
. - ImageFormat
-
Represents image format.
- ImageFormat.JPEGMarker
-
https://en.wikipedia.org/wiki/JPEG
- ImageProcessItem
-
Represents an item which could be processed by an
ImageProcessor
. - Radius
-
Represents a radius specified in a
RoundCornerImageProcessor
. - ContentMode
-
Represents how a size adjusts itself to fit a target size.
- ImageProgressive.UpdatingStrategy
-
The updating strategy when an intermediate progressive image is generated and about to be set to the hosting view.
- ImageTransition
-
Transition effect which will be used when an image downloaded and set by
UIImageView
extension API in Kingfisher. You can assign an enum value with transition duration as an item inKingfisherOptionsInfo
to enable the animation transition. - ImageTransition
- RetryDecision
-
Represents decision of behavior on the current retry.
- DelayRetryStrategy.Interval
-
Represents the interval mechanism which used in a
DelayRetryStrategy
. - CallbackQueue
-
Represents callback queue behaviors when an calling of closure be dispatched.
- AnimatedImageView.RepeatCount
-
Enumeration that specifies repeat count of GIF
- IndicatorType
-
Represents the activity indicator type which should be added to an image view when an image is being downloaded.
- IndicatorSizeStrategy
Protocols
- CacheSerializer
-
An
CacheSerializer
is used to convert some data to an image object after retrieving it from disk storage, and vice versa, to convert an image to data object for storing to the disk storage. - CacheCostCalculable
-
Represents types which cost in memory can be calculated.
- DataTransformable
-
Represents types which can be converted to and from data.
- ImageDataProvider
-
Represents a data provider to provide image data to Kingfisher when setting with
Source.provider
source. Compared toSource.network
member, it gives a chance to load some image data in your own way, as long as you can provide the data representation for the image. - Resource
-
Represents an image resource at a certain url and a given cache key. Kingfisher will use a
Resource
to download a resource from network and cache it with the cache key when usingSource.network
as its image setting source. - KFOptionSetter
- KingfisherCompatible
-
Represents an object type that is compatible with Kingfisher. You can use
kf
property to get a value in the namespace of Kingfisher. - KingfisherCompatibleValue
-
Represents a value type that is compatible with Kingfisher. You can use
kf
property to get a value in the namespace of Kingfisher. - CIImageProcessor
-
Represents a processor based on a
CIImage
Filter
. It requires a filter to create anImageProcessor
. - ImageProcessor
-
An
ImageProcessor
would be used to convert some downloaded data to an image. - Placeholder
-
Represents a placeholder type which could be set while loading as well as loading finished without getting an image.
- AuthenticationChallengeResponsible
-
Protocol indicates that an authentication challenge could be handled.
- ImageDownloaderDelegate
-
Protocol of
ImageDownloader
. This protocol provides a set of methods which are related to image downloader working stages and rules. - ImageModifier
-
An
ImageModifier
can be used to change properties on an image between cache serialization and the actual use of the image. Themodify(_:)
method will be called after the image retrieved from its source and before it returned to the caller. This modified image is expected to be only used for rendering purpose, any changes applied by theImageModifier
will not be serialized or cached. - ImageDownloadRedirectHandler
-
Represents and wraps a method for modifying request during an image download request redirection.
- AsyncImageDownloadRequestModifier
-
Represents and wraps a method for modifying request before an image download request starts in an asynchronous way.
- ImageDownloadRequestModifier
-
Represents and wraps a method for modifying request before an image download request starts.
- RetryStrategy
-
Defines a retry strategy can be applied to a
.retryStrategy
option. - KFImageProtocol
- KFImageHoldingView
- OptionalProtocol
- AnimatedImageViewDelegate
-
Protocol of
AnimatedImageView
. - Indicator
-
An indicator type which can be used to show the download task is in progress.
Typealiases
- KFCrossPlatformImage
- KFCrossPlatformView
- KFCrossPlatformColor
- KFCrossPlatformImageView
- KFCrossPlatformButton
- KFCrossPlatformImage
- KFCrossPlatformColor
- KFCrossPlatformImageView
- KFCrossPlatformView
- KFCrossPlatformButton
- DownloadProgressBlock
-
The downloading progress block type. The parameter value is the
receivedSize
of current response. The second parameter is the total expected data length from response's "Content-Length" header. If the expected length is not available, this block will not be called. - DownloadTaskUpdatedBlock
-
The downloading task updated block type. The parameter
newTask
is the updated new task of image setting process. It is anil
if the image loading does not require an image downloading process. If an image downloading is issued, this value will contain the actualDownloadTask
for you to keep and cancel it later if you need. - KingfisherOptionsInfo
-
KingfisherOptionsInfo is a typealias for [KingfisherOptionsInfoItem]. You can use the enum of option item with value to control some behaviors of Kingfisher.
- Transformer
-
Represents the type of transformer method, which will be used in to provide a
Filter
. - AuthenticationChallengeResponsable
- PrefetcherProgressBlock
-
Progress update block of prefetcher when initialized with a list of resources.
- PrefetcherSourceProgressBlock
-
Progress update block of prefetcher when initialized with a list of resources.
- PrefetcherCompletionHandler
-
Completion block of prefetcher when initialized with a list of sources.
- PrefetcherSourceCompletionHandler
-
Completion block of prefetcher when initialized with a list of sources.
- ExecutionQueue
- IndicatorView
- IndicatorView
Variables
- KingfisherDiskCacheCleanedHashKey
-
Key for array of cleaned hashes in
userInfo
ofKingfisherDidCleanDiskCacheNotification
.
Operators
- |>
Extensions
- Data
- KFCrossPlatformImage
- Notification.Name
- Optional
- URL