### playbackMode Source: https://sdwebimage.github.io/documentation/sdwebimage/sdanimatedimageplayer/playbackmode Asynchronous setup animation playback mode. Default mode is SDAnimatedImagePlaybackModeNormal. ```APIDOC ## playbackMode ### Description Asynchronous setup animation playback mode. Default mode is SDAnimatedImagePlaybackModeNormal. ### Property `var playbackMode: SDAnimatedImagePlaybackMode { get set }` ``` -------------------------------- ### Setup ImagePlayer with Animated Image Source: https://sdwebimage.github.io/documentation/sdwebimageswiftui/imageplayer/setupplayer%28animatedimage%3A%29 Use this method to set up the ImagePlayer with an animated image. After setup, you can check the `isValid` status or call `startPlaying` to play the animation. Requires iOS 14.0+, iPadOS 14.0+, Mac Catalyst 14.0+, macOS 11.0+, tvOS 14.0+, watchOS 7.0+. ```swift func setupPlayer(animatedImage: PlatformImage & SDAnimatedImageProvider) ``` -------------------------------- ### Start Animation Playback Source: https://sdwebimage.github.io/documentation/sdwebimageswiftui/imageplayer Starts the animation playback of the set animated image. ```swift func startPlaying() ``` -------------------------------- ### prepares Source: https://sdwebimage.github.io/documentation/sdwebimage/sdwebimagetransition/prepares A block object to be executed before the animation sequence starts. ```APIDOC ## prepares ### Description A block object to be executed before the animation sequence starts. ### Instance Property ```swift var prepares: SDWebImageTransitionPreparesBlock? { get set } ``` ``` -------------------------------- ### startPlaying() Source: https://sdwebimage.github.io/documentation/sdwebimage/sdanimatedimageplayer/startplaying%28%29 Starts the animation or resumes a previously paused animation for an SDAnimatedImagePlayer instance. ```APIDOC ## startPlaying() ### Description Starts the animation or resumes a previously paused animation. ### Method Instance Method ### Signature ```swift func startPlaying() ``` ``` -------------------------------- ### Flip From Top Transition Example Source: https://sdwebimage.github.io/documentation/sdwebimage/sdwebimagetransition Provides a flip-from-top transition effect for image loading. Use this for a flipping animation originating from the top. ```swift SDWebImageTransition.flipFromTop ``` -------------------------------- ### Start Indicator Animation Source: https://sdwebimage.github.io/documentation/sdwebimage/sdwebimageindicator/startanimatingindicator%28%29 Call this instance method to begin the indicator's animation. No parameters are required. ```swift func startAnimatingIndicator() ``` -------------------------------- ### Flip From Bottom Transition Example Source: https://sdwebimage.github.io/documentation/sdwebimage/sdwebimagetransition Provides a flip-from-bottom transition effect for image loading. Use this for a flipping animation originating from the bottom. ```swift SDWebImageTransition.flipFromBottom ``` -------------------------------- ### Curl Up Transition Example Source: https://sdwebimage.github.io/documentation/sdwebimage/sdwebimagetransition Provides a curl-up transition effect for image loading. Use this for a page-curl like animation. ```swift SDWebImageTransition.curlUp ``` -------------------------------- ### init(block:) Source: https://sdwebimage.github.io/documentation/sdwebimage/sdwebimageoptionsprocessor-swift.class/init%28block%3A%29 Initializes an SDWebImageOptionsProcessor with a closure that will be executed to process image loading options. ```APIDOC ## init(block:) ### Description Initializes an SDWebImageOptionsProcessor with a block that processes image loading options. ### Parameters #### Block Parameter - **block** (SDWebImageOptionsProcessorBlock) - Required - A closure that takes `options` and `url` and returns modified `options`. ``` -------------------------------- ### Get Image Format Source: https://sdwebimage.github.io/documentation/sdwebimage/sdimageioanimatedcoder/imageformat Retrieve the supported animated image format. For example, `SDImageFormatGIF`. ```swift class var imageFormat: SDImageFormat { get } ``` -------------------------------- ### setupPlayer(animatedImage:) Source: https://sdwebimage.github.io/documentation/sdwebimageswiftui/imageplayer/setupplayer%28animatedimage%3A%29 Sets up the ImagePlayer with an animated image. After setup, you can check the `isValid` status or call `startPlaying` to play the animation. This method is available on iOS 14.0+, iPadOS 14.0+, Mac Catalyst 14.0+, macOS 11.0+, tvOS 14.0+, and watchOS 7.0+. ```APIDOC ## setupPlayer(animatedImage:) ### Description Sets up the player using an Animated Image. After setup, you can always check the `isValid` status, or call `startPlaying` to play the animation. ### Parameters - **animatedImage** (PlatformImageImage & SDAnimatedImageProvider) - The animated image to use for setting up the player. ### Availability iOS 14.0+ iPadOS 14.0+ Mac Catalyst 14.0+ macOS 11.0+ tvOS 14.0+ watchOS 7.0+ ``` -------------------------------- ### isSuspended Source: https://sdwebimage.github.io/documentation/sdwebimage/sdwebimagedownloader/issuspended Gets or sets the suspension state of the download queue. When suspended, new downloads will not start until it is resumed. ```APIDOC ## isSuspended ### Description Gets or sets the download queue suspension state. When `isSuspended` is set to `true`, new downloads will not start. Setting it to `false` will resume any suspended downloads. ### Property `var isSuspended: Bool { get set }` ### Usage #### Get Suspension State ```swift let suspended = SDWebImageDownloader.shared.isSuspended ``` #### Suspend Downloads ```swift SDWebImageDownloader.shared.isSuspended = true ``` #### Resume Downloads ```swift SDWebImageDownloader.shared.isSuspended = false ``` ``` -------------------------------- ### init(url:options:context:isAnimating:placeholder:) Source: https://sdwebimage.github.io/documentation/sdwebimageswiftui/animatedimage/init%28url%3Aoptions%3Acontext%3Aisanimating%3Aplaceholder%3A%29 Creates an animated image view with a specified URL, custom download options, context for additional processing, a binding to control animation, and a placeholder view. ```APIDOC ## init(url:options:context:isAnimating:placeholder:) ### Description Create an animated image with url, placeholder, custom options and context, including animation control binding. ### Parameters - **url** (URL?) - The image url. - **options** (SDWebImageOptions) - The options to use when downloading the image. See `SDWebImageOptions` for the possible values. - **context** ([SDWebImageContextOption : Any]?) - A context contains different options to perform specify changes or processes, see `SDWebImageContextOption`. This hold the extra objects which `options` enum can not hold. - **isAnimating** (Binding) - The binding for animation control. - **placeholder** (@escaping () -> T where T : View) - The placeholder image to show during loading. ``` -------------------------------- ### currentLoopCount Source: https://sdwebimage.github.io/documentation/sdwebimage/sdanimatedimageplayer/currentloopcount Gets the current loop count of the animated image since it started animating. This property is KVO compliant. ```APIDOC ## currentLoopCount ### Description Gets the current loop count of the animated image since it started animating. This property is KVO compliant. ### Property `var currentLoopCount: UInt { get }` ### Return Value The current loop count as an unsigned integer. ``` -------------------------------- ### SDWebImageOptions Low Priority Property Source: https://sdwebimage.github.io/documentation/sdwebimage/sdwebimageoptions/lowpriority This static property is used to enable low priority image downloads. It disables the default behavior of starting downloads during UI interactions, causing downloads to be delayed, for example, during UIScrollView deceleration. ```swift static var lowPriority: SDWebImageOptions { get } ``` -------------------------------- ### init(request:in:options:context:) Source: https://sdwebimage.github.io/documentation/sdwebimage/sdwebimagedownloaderoperationprotocol/init%28request%3Ain%3Aoptions%3Acontext%3A%29 Initializes a new downloader operation. This initializer allows you to specify the request, the URLSession to use, any download options, and a context dictionary for additional options. ```APIDOC ## init(request:in:options:context:) ### Description Initializes a new downloader operation with the specified request, URL session, options, and context. ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Parameters - **request** (URLRequest?) - The URL request object to be used for the download. - **session** (URLSession?) - The URLSession to use for the download. Defaults to the shared URLSession if nil. - **options** (SDWebImageDownloaderOptions) - Options to control the download process. Defaults to an empty set. - **context** ([SDWebImageContextOption : Any]?) - A dictionary for additional context and options. Defaults to nil. ``` -------------------------------- ### init(url:scale:options:context:isAnimating:) Source: https://sdwebimage.github.io/documentation/sdwebimageswiftui/webimage/init%28url%3Ascale%3Aoptions%3Acontext%3Aisanimating%3A%29 Creates a WebImage with a specified URL, scale, loading options, context for advanced customization, and an optional binding to control animation. ```APIDOC ## init(url:scale:options:context:isAnimating:) ### Description Create a web image with url, placeholder, custom options and context. Optional can support animated image using Binding. ### Parameters #### `url` (URL?) - The image url #### `scale` (CGFloat) - The scale to use for the image. The default is 1. Set a different value when loading images designed for higher resolution displays. For example, set a value of 2 for an image that you would name with the @2x suffix if stored in a file on disk. #### `options` (SDWebImageOptions) - The options to use when downloading the image. See `SDWebImageOptions` for the possible values. #### `context` ([SDWebImageContextOption : Any]?) - A context contains different options to perform specify changes or processes, see `SDWebImageContextOption`. This hold the extra objects which `options` enum can not hold. #### `isAnimating` (Binding) - The binding for animation control. When the animation started, this binding can been used to start / stop the animation. You can still customize the `.animatedImageClass` context for advanced custom animation. ``` -------------------------------- ### init(size:format:) Source: https://sdwebimage.github.io/documentation/sdwebimage/sdgraphicsimagerenderer/init%28size%3Aformat%3A%29 Creates a new image renderer with a given size and format. The size defines the dimensions of the output images, and the format specifies the rendering context properties. ```APIDOC ## init(size:format:) ### Description Creates a new image renderer with a given size and format. ### Parameters #### Parameters - **size** (CGSize) - The size of images output from the renderer, specified in points. - **format** (SDGraphicsImageRendererFormat) - A SDGraphicsImageRendererFormat object that encapsulates the format used to create the renderer context. ``` -------------------------------- ### Objective-C SDImageFormat Definition Example Source: https://sdwebimage.github.io/documentation/sdwebimage/sdimagecoder/canencode%28to%3A%29 Example of defining a custom SDImageFormat in Objective-C, which is relevant for custom coders introducing new image formats. ```objective-c Static const SDImageFormat SDImageFormatHEIF = 10; ``` -------------------------------- ### Initializer Source: https://sdwebimage.github.io/documentation/sdwebimage/sdwebimagedownloaderoperation-swift.class/init%28request%3Ain%3Aoptions%3A%29 Initializes a `SDWebImageDownloaderOperation` object. ```APIDOC ## init(request:in:options:) ### Description Initializes a `SDWebImageDownloaderOperation` object. ### Parameters #### Parameters - **request** (URLRequest?) - The URL request. - **session** (URLSession?) - The URL session in which this operation will run. - **options** (SDWebImageDownloaderOptions) - Downloader options. Defaults to `[]`. ``` -------------------------------- ### Get Image Load Operation by Key Source: https://sdwebimage.github.io/documentation/sdwebimageswiftui/uikit/uiview/sd_imageloadoperation%28forkey%3A%29 Use this method to get an existing SDWebImage operation for a given key on a UIView. It returns an optional SDWebImageOperation. ```swift @MainActor func sd_imageLoadOperation(forKey key: String?) -> (any SDWebImageOperation)? ``` -------------------------------- ### Fade Transition Example Source: https://sdwebimage.github.io/documentation/sdwebimage/sdwebimagetransition Provides a fade-in transition effect for image loading. Use this when you want a simple fade animation. ```swift SDWebImageTransition.fade ``` -------------------------------- ### Flip From Left Transition Example Source: https://sdwebimage.github.io/documentation/sdwebimage/sdwebimagetransition Provides a flip-from-left transition effect for image loading. Use this for a flipping animation originating from the left. ```swift SDWebImageTransition.flipFromLeft ``` -------------------------------- ### Get Current Image URL from UIButton Source: https://sdwebimage.github.io/documentation/sdwebimageswiftui/uikit/uibutton/sd_currentimageurl Access the sd_currentImageURL property to get the URL of the image currently set on the UIButton. This property is available on the main actor. ```swift @MainActor var sd_currentImageURL: URL? { get } ``` -------------------------------- ### init() Source: https://sdwebimage.github.io/documentation/sdwebimage/sdwebimageoptions/init%28%29 Initializes a new instance of SDWebImageOptions. This initializer is inherited from the OptionSet protocol and is available when the RawValue conforms to FixedWidthInteger. ```APIDOC ## init() ### Description Initializes a new instance of SDWebImageOptions. This initializer is inherited from the OptionSet protocol and is available when the RawValue conforms to FixedWidthInteger. ### Method `init()` ### Parameters This initializer does not take any parameters. ### Response Returns a new instance of `SDWebImageOptions`. ``` -------------------------------- ### Get and Set maxMemoryCount Source: https://sdwebimage.github.io/documentation/sdwebimage/sdimagecacheconfig/maxmemorycount This snippet shows how to get and set the maximum number of objects the in-memory image cache should hold. A value of 0 means there is no limit. ```swift var maxMemoryCount: UInt { get set } ``` -------------------------------- ### init(config:) Source: https://sdwebimage.github.io/documentation/sdwebimage/sdwebimagedownloader/init%28config%3A%29 Creates an instance of a downloader with specified downloader config. You can specify session configuration, timeout or operation class through downloader config. ```APIDOC ## init(config:) ### Description Creates an instance of a downloader with specified downloader config. You can specify session configuration, timeout or operation class through downloader config. ### Parameters #### Parameters - **config** (SDWebImageDownloaderConfig?) - The downloader config. If you specify nil, the `defaultDownloaderConfig` will be used. ``` -------------------------------- ### Get and Set Image Loop Count Source: https://sdwebimage.github.io/documentation/sdwebimageswiftui/uikit/uiimage/sd_imageloopcount This property allows you to get or set the loop count for animated images when using SDWebImageSwiftUI with UIKit. A value of 0 typically indicates infinite looping. ```swift var sd_imageLoopCount: UInt { get set } ``` -------------------------------- ### Initializer Source: https://sdwebimage.github.io/documentation/sdwebimage/sdwebimageoptionsresult/init%28options%3Acontext%3A%29 Initializes SDWebImageOptionsResult with provided options and context. ```APIDOC ## init(options:context:) ### Description Create a new options result. ### Parameters #### options - **options** (SDWebImageOptions) - Options for the image loading. #### context - **context** ([SDWebImageContextOption : Any]?) - Contextual information for the image loading. ``` -------------------------------- ### Get Cache Path for Key in Swift Source: https://sdwebimage.github.io/documentation/sdwebimage/sdimagecache-swift.class/cachepath%28forkey%3A%29 Use this method to get the file system path for a cached image using its unique key. The key is optional. The return value is an optional String representing the path. ```swift func cachePath(forKey key: String?) -> String? ``` -------------------------------- ### help(_:) Source: https://sdwebimage.github.io/documentation/sdwebimageswiftui/webimage/help%28_%3A%29-79yfh The `help(_:)` method is inherited from the `View` protocol and is available in SDWebImageSwiftUI. It allows you to attach help text to a view, which can be localized using `LocalizedStringKey`. ```APIDOC ## help(_:) ### Description Attaches a localized help text to the view. This method is inherited from the `View` protocol. ### Method `func help(_ textKey: LocalizedStringKey) -> some View` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) Returns a modified view with help text attached. #### Response Example None ### Availability - iOS 14.0+ - iPadOS 14.0+ - Mac Catalyst 14.0+ - macOS 11.0+ - tvOS 14.0+ - watchOS 7.0+ ``` -------------------------------- ### Customizing Cache Serialization with a Block Source: https://sdwebimage.github.io/documentation/sdwebimage/sdwebimagemanager/cacheserializer Example of setting a custom cache serializer using a block. This specific example handles WebP images by returning the original data if it's not a multi-frame WebP, otherwise it returns nil to allow SDWebImage to handle serialization. ```objc SDWebImageManager.sharedManager.cacheSerializer = [SDWebImageCacheSerializer cacheSerializerWithBlock:^NSData * _Nullable(UIImage * _Nonnull image, NSData * _Nullable data, NSURL * _Nullable imageURL) { SDImageFormat format = [NSData sd_imageFormatForImageData:data]; switch (format) { case SDImageFormatWebP: return image.images ? data : nil; default: return data; } }]; ``` -------------------------------- ### Initializers Source: https://sdwebimage.github.io/documentation/sdwebimage/sdwebimageoptions/setalgebra-implementations Provides information on how to initialize SetAlgebra instances. ```APIDOC ## Initializers ### `init(S)` Initializes a new instance with a generic type `S`. ### `init(arrayLiteral: Self.Element...)` Initializes a new instance using an array literal. ``` -------------------------------- ### Initializer Source: https://sdwebimage.github.io/documentation/sdwebimage/sdwebimagedownloaderoperation-swift.class/init%28request%3Ain%3Aoptions%3Acontext%3A%29 Initializes a SDWebImageDownloaderOperation object with the specified request, session, options, and context. ```APIDOC ## init(request:in:options:context:) ### Description Initializes a `SDWebImageDownloaderOperation` object. ### Parameters `request` The URL request `session` The URL session in which this operation will run `options` Downloader options `context` A context contains different options to perform specify changes or processes, see `SDWebImageContextOption`. This hold the extra objects which `options` enum can not hold. ``` -------------------------------- ### Initializers Source: https://sdwebimage.github.io/documentation/sdwebimage/sdwebimagedownloaderoperation-swift.class Initializes a SDWebImageDownloaderOperation object with the specified request, session, options, and context. ```APIDOC ## Initializers ### `convenience init(request: URLRequest?, in: URLSession?, options: SDWebImageDownloaderOptions)` Initializes a `SDWebImageDownloaderOperation` object. ### `init(request: URLRequest?, in: URLSession?, options: SDWebImageDownloaderOptions, context: [SDWebImageContextOption : Any]?)` Initializes a `SDWebImageDownloaderOperation` object. ``` -------------------------------- ### isPlaying Source: https://sdwebimage.github.io/documentation/sdwebimageswiftui/imageplayer/isplaying Gets the current playing status of the ImagePlayer. This is a read-only property. ```APIDOC ## isPlaying ### Description Gets the current playing status of the ImagePlayer. This is a read-only property. ### Property - **isPlaying** (Bool) - Read-only. Indicates if the player is currently playing. ### Availability iOS 14.0+ iPadOS 14.0+ Mac Catalyst 14.0+ macOS 11.0+ tvOS 14.0+ watchOS 7.0+ ``` -------------------------------- ### Prefetch URLs with Options, Context, Progress, and Completion Source: https://sdwebimage.github.io/documentation/sdwebimage/sdwebimageprefetcher/prefetchurls%28_%3Aoptions%3Acontext%3Aprogress%3Acompleted%3A%29 Use this method to initiate prefetching for a list of URLs. You can specify download options, context for custom processing, and blocks to monitor progress and completion. The returned token can be used to cancel the prefetching process. ```swift func prefetchURLs( _ urls: [URL]?, options: SDWebImageOptions = [], context: [SDWebImageContextOption : Any]?, progress progressBlock: SDWebImagePrefetcherProgressBlock?, completed completionBlock: SDWebImagePrefetcherCompletionBlock? = nil ) -> SDWebImagePrefetchToken? ``` -------------------------------- ### rect Source: https://sdwebimage.github.io/documentation/sdwebimage/sdimagecroppingtransformer/rect Gets the image's inner rectangle. This property is read-only. ```APIDOC ## rect ### Description Gets the image's inner rectangle. ### Property `rect` (CGRect) - Read-only. The image's inner rect. ### Usage ```swift var rect: CGRect { get } ``` ``` -------------------------------- ### init(size:) Source: https://sdwebimage.github.io/documentation/sdwebimage/sdgraphicsimagerenderer/init%28size%3A%29 Creates an image renderer for drawing images of a given size. The size is specified in points. ```APIDOC ## init(size:) ### Description Creates an image renderer for drawing images of a given size. ### Parameters #### Parameters - **size** (CGSize) - Required - The size of images output from the renderer, specified in points. ``` -------------------------------- ### currentFrame Source: https://sdwebimage.github.io/documentation/sdwebimage/sdanimatedimageview/currentframe Gets the current display frame image. This property is KVO compliant. ```APIDOC ## currentFrame ### Description Gets the current display frame image. This property is KVO compliant. ### Property `@MainActor var currentFrame: UIImage? { get }` ``` -------------------------------- ### init(radius:corners:borderWidth:borderColor:) Source: https://sdwebimage.github.io/documentation/sdwebimage/sdimageroundcornertransformer/init%28radius%3Acorners%3Aborderwidth%3Abordercolor%3A%29 Initializes an `SDImageRoundCornerTransformer` with specified corner radius, target corners, border width, and border color. ```APIDOC ## init(radius:corners:borderWidth:borderColor:) ### Description Initializes an `SDImageRoundCornerTransformer` with specified corner radius, target corners, border width, and border color. ### Parameters #### Path Parameters - None #### Query Parameters - None #### Request Body - None ### Method Signature ```swift convenience init( radius cornerRadius: CGFloat, corners: SDRectCorner, borderWidth: CGFloat, borderColor: UIColor? ) ``` ### Parameters - **cornerRadius** (CGFloat) - Required - The radius of the rounded corners. - **corners** (SDRectCorner) - Required - The specific corners to apply the rounding to. - **borderWidth** (CGFloat) - Required - The width of the border to be applied. - **borderColor** (UIColor?) - Optional - The color of the border. If nil, no border is drawn. ``` -------------------------------- ### currentFrame Source: https://sdwebimage.github.io/documentation/sdwebimage/sdanimatedimageplayer/currentframe Gets the current playing frame image. This property is KVO Compliance. ```APIDOC ## currentFrame ### Description Retrieves the current frame of the animated image as a `UIImage` object. This property is Key-Value Observing (KVO) compliant, allowing you to observe changes to the current frame. ### Property `currentFrame` ### Type `UIImage?` ### Access Read-only (`get`) ``` -------------------------------- ### init(imageManager:) Source: https://sdwebimage.github.io/documentation/sdwebimage/sdwebimageprefetcher/init%28imagemanager%3A%29 Allows you to instantiate a prefetcher with any arbitrary image manager. ```APIDOC ## init(imageManager:) ### Description Allows you to instantiate a prefetcher with any arbitrary image manager. ### Method Initializer ### Parameters #### Path Parameters - **manager** (SDWebImageManager) - Required - The image manager to be used by the prefetcher. ### Request Example ```swift let customManager = SDWebImageManager() let prefetcher = SDWebImagePrefetcher(imageManager: customManager) ``` ### Response #### Success Response An instance of `SDWebImagePrefetcher` initialized with the provided `SDWebImageManager`. #### Response Example ```swift // No direct response object, but the prefetcher is now configured. ``` ``` -------------------------------- ### Simple SDWebImageManager Usage Example Source: https://sdwebimage.github.io/documentation/sdwebimage/sdwebimagemanager Demonstrates how to use SDWebImageManager to load an image from a URL and handle the result. This is useful for loading images outside of a UIView context. ```objc SDWebImageManager *manager = [SDWebImageManager sharedManager]; [manager loadImageWithURL:imageURL options:0 progress:nil completed:^(UIImage *image, NSData *data, NSError *error, SDImageCacheType cacheType, BOOL finished, NSURL *imageURL) { if (image) { // do something with image } }]; ``` -------------------------------- ### Get isPlaying Status Source: https://sdwebimage.github.io/documentation/sdwebimageswiftui/imageplayer/isplaying Retrieve the current playing status of the ImagePlayer. This is a read-only property. ```swift var isPlaying: Bool { get } ``` -------------------------------- ### init(namespace:diskCacheDirectory:config:) Source: https://sdwebimage.github.io/documentation/sdwebimage/sdimagecache-swift.class/init%28namespace%3Adiskcachedirectory%3Aconfig%3A%29 Initializes a new cache store with a specific namespace, directory, and configuration. The final disk cache directory is formed by combining the provided directory and namespace (e.g., `$directory/$namespace`). ```APIDOC ## init(namespace:diskCacheDirectory:config:) ### Description Initializes a new cache store with a specific namespace, directory, and configuration. The final disk cache directory is formed by combining the provided directory and namespace (e.g., `$directory/$namespace`). The default configuration for a shared cache results in a directory like `~/Library/Caches/com.hackemist.SDImageCache/default/`. ### Method `init` ### Parameters #### Parameters - **ns** (String) - The namespace to use for this cache store. - **directory** (String?) - Directory to cache disk images in. - **config** (SDImageCacheConfig?) - The cache config to be used to create the cache. You can provide custom memory cache or disk cache class in the cache config. ``` -------------------------------- ### Get tintColor Property Source: https://sdwebimage.github.io/documentation/sdwebimage/sdimagetinttransformer/tintcolor This is the declaration for the tintColor property. It is a read-only property that returns a UIColor. ```swift var tintColor: UIColor { get } ``` -------------------------------- ### init(version:) Source: https://sdwebimage.github.io/documentation/sdwebimage/sdwebimagedownloaderresponsemodifier-swift.class/init%28version%3A%29 Initializes an SDWebImageDownloaderResponseModifier with a given HTTP version. The status code defaults to 200. ```APIDOC ## init(version:) ### Description Creates the response modifier with HTTP Version. Status code defaults to 200. ### Method Signature ```swift init(version: String?) ``` ### Parameters #### Parameters - **version** (String?) - Optional - HTTP Version, nil means “HTTP/1.1”. ``` -------------------------------- ### animatedImageLoopCount Source: https://sdwebimage.github.io/documentation/sdwebimage/sdanimatedimageprovider/animatedimageloopcount Gets the animation loop count. A value of 0 indicates infinite looping. ```APIDOC ## animatedImageLoopCount ### Description Gets the animation loop count. A value of 0 indicates infinite looping. ### Return Value - **UInt**: The animation loop count. ``` -------------------------------- ### SDWebImageContextOption Initializers Source: https://sdwebimage.github.io/documentation/sdwebimage/sdwebimagecontextoption Provides methods to initialize SDWebImageContextOption. Use these to create specific option values for image loading. ```swift init(String) ``` ```swift init(rawValue: String) ``` -------------------------------- ### scenePadding Source: https://sdwebimage.github.io/documentation/sdwebimageswiftui/webimage/view-implementations Applies padding that respects the scene's safe areas and layout guides. ```APIDOC ## Instance Methods `func scenePadding(Edge.Set) -> some View` `func scenePadding(ScenePadding, edges: Edge.Set) -> some View` ``` -------------------------------- ### help(_:) Source: https://sdwebimage.github.io/documentation/sdwebimageswiftui/animatedimage/help%28_%3A%29-5qk6t This instance method is inherited from the View protocol and is available for AnimatedImage. It allows providing help text associated with the view. ```APIDOC ## help(_:) ### Description Inherited from `View.help(_:)`. This method allows associating help text with the AnimatedImage view. ### Method `func help(_ text: Text) -> some View` ### Availability - SDWebImageSwiftUI - swiftui - Core - iOS 14.0+ - iPadOS 14.0+ - Mac Catalyst 14.0+ - macOS 11.0+ - tvOS 14.0+ - watchOS 7.0+ ``` -------------------------------- ### White Style Activity Indicator Source: https://sdwebimage.github.io/documentation/sdwebimage/sdwebimageactivityindicator/white Access the static 'white' property to get a white-style SDWebImageActivityIndicator. ```swift class var white: SDWebImageActivityIndicator { get } ``` -------------------------------- ### SDImageCacheConfig.shouldCacheImagesInMemory Property Source: https://sdwebimage.github.io/documentation/sdwebimage/sdimagecacheconfig/shouldcacheimagesinmemory This property determines if images should be cached in memory. It is a boolean value that can be get and set. ```swift var shouldCacheImagesInMemory: Bool { get set } ``` -------------------------------- ### Get and Set Playback Mode Source: https://sdwebimage.github.io/documentation/sdwebimage/sdanimatedimageplayer/playbackmode Access and modify the animation playback mode. The default is SDAnimatedImagePlaybackModeNormal. ```swift var playbackMode: SDAnimatedImagePlaybackMode { get set } ``` -------------------------------- ### init(_:) Source: https://sdwebimage.github.io/documentation/sdwebimage/sdwebimagecontextoption/init%28_%3A%29 Initializes an SDWebImageContextOption with a given raw string value. This is useful for creating custom context options or when deserializing options from a string representation. ```APIDOC ## init(_:) ### Description Initializes an `SDWebImageContextOption` using a raw string value. This initializer is part of the `SDWebImageContextOption` type, allowing for the creation of context options from their string representations. ### Method `init(_:)` ### Parameters #### Path Parameters - **rawValue** (String) - Required - The raw string value to initialize the option with. ``` -------------------------------- ### init(transformers:) Source: https://sdwebimage.github.io/documentation/sdwebimage/sdimagepipelinetransformer/init%28transformers%3A%29 Initializes the SDImagePipelineTransformer with a sequence of transformers. These transformers will be applied in the order they are provided. ```APIDOC ## init(transformers:) ### Description Initializes the SDImagePipelineTransformer with a sequence of transformers. These transformers will be applied in the order they are provided. ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Method Initializer ### Endpoint None ### Request Example None ### Response #### Success Response (200) None #### Response Example None ``` -------------------------------- ### playbackMode Source: https://sdwebimage.github.io/documentation/sdwebimage/sdanimatedimageview/playbackmode Controls the asynchronous setup animation playback mode for SDAnimatedImageView. The default mode is SDAnimatedImagePlaybackModeNormal. ```APIDOC ## playbackMode ### Description Asynchronous setup animation playback mode. ### Property `@MainActor var playbackMode: SDAnimatedImagePlaybackMode { get set }` ### Default Value SDAnimatedImagePlaybackModeNormal ``` -------------------------------- ### init(namespace:diskCacheDirectory:) Source: https://sdwebimage.github.io/documentation/sdwebimage/sdimagecache-swift.class/init%28namespace%3Adiskcachedirectory%3A%29 Initializes a new cache store with a specific namespace and directory. The final disk cache directory will be structured as ($directory/$namespace). ```APIDOC ## init(namespace:diskCacheDirectory:) ### Description Initializes a new cache store with a specific namespace and directory. The final disk cache directory should look like ($directory/$namespace). ### Method convenience init ### Parameters #### Path Parameters * **ns** (String) - Required - The namespace to use for this cache store * **directory** (String?) - Optional - Directory to cache disk images in ``` -------------------------------- ### init(provider:) Source: https://sdwebimage.github.io/documentation/sdwebimage/sdanimatedimageplayer/init%28provider%3A%29 Creates a player with an animated image provider. Returns nil if the provider's `animatedImageFrameCount` is less than 1. The provider can be any protocol implementation, such as `SDAnimatedImage` or `SDImageGIFCoder`. ```APIDOC ## init?(provider:) ### Description Create a player with animated image provider. If the provider’s `animatedImageFrameCount` is less than 1, returns nil. The provider can be any protocol implementation, like `SDAnimatedImage`, `SDImageGIFCoder`, etc. ### Parameters - **provider** (any SDAnimatedImageProvider) - The animated provider ``` -------------------------------- ### Get Image Data Source: https://sdwebimage.github.io/documentation/sdwebimageswiftui/uikit/uiimage Converts the UIImage into Data. This can be done for a specific image format and compression quality. ```swift func sd_imageData() -> Data? ``` ```swift func sd_imageData(as: SDImageFormat) -> Data? ``` ```swift func sd_imageData(as: SDImageFormat, compressionQuality: Double) -> Data? ``` ```swift func sd_imageData(as: SDImageFormat, compressionQuality: Double, firstFrameOnly: Bool) -> Data? ``` -------------------------------- ### Set Image with URL, Placeholder, Options, Progress, and Completion Source: https://sdwebimage.github.io/documentation/sdwebimageswiftui/uikit/uiimageview Load an image from a URL with a placeholder, custom options, progress tracking, and a completion block. This method is useful when context-specific configurations are not needed. ```swift func sd_setImage(with: URL?, placeholderImage: UIImage?, options: SDWebImageOptions, progress: SDImageLoaderProgressBlock?, completed: SDExternalCompletionBlock?) ``` -------------------------------- ### Get Color at Point Source: https://sdwebimage.github.io/documentation/sdwebimageswiftui/uikit/uiimage Retrieves the UIColor of a specific pixel in the UIImage. Requires the image to be decoded first. ```swift func sd_color(at: CGPoint) -> UIColor? ``` -------------------------------- ### SDWebImageLoadState URL Property Source: https://sdwebimage.github.io/documentation/sdwebimage/sdwebimageloadstate/url This property represents the image loading URL. It is accessible for both getting and setting the URL. ```swift var url: URL? { get set } ``` -------------------------------- ### SDWebImageDownloader Initializers Source: https://sdwebimage.github.io/documentation/sdwebimage/sdwebimagedownloader Provides documentation for the initializers of the SDWebImageDownloader class. ```APIDOC ## init(config: SDWebImageDownloaderConfig?) ### Description Creates an instance of a downloader with specified downloader config. You can specify session configuration, timeout or operation class through downloader config. ### Parameters #### Initializer Parameters - **config** (SDWebImageDownloaderConfig?) - Optional - Downloader configuration object. ``` -------------------------------- ### Get the Download URL Source: https://sdwebimage.github.io/documentation/sdwebimage/sdwebimagedownloadtoken/url Access the URL property to retrieve the URL associated with the download. This property is read-only. ```swift var url: URL? { get } ``` -------------------------------- ### OptionSet Implementations Source: https://sdwebimage.github.io/documentation/sdwebimage/sdwebimagedownloaderoptions/optionset-implementations Details the available initializers and instance methods for managing OptionSet types within SDWebImageDownloaderOptions. ```APIDOC ## OptionSet Implementations ### Initializers `init()` Initializes a new instance of the OptionSet. ### Instance Methods `func contains(Self) -> Bool` Checks if the OptionSet contains a specific element. `func formIntersection(Self)` Forms the intersection of the OptionSet with another. `func formSymmetricDifference(Self)` Forms the symmetric difference of the OptionSet with another. `func formUnion(Self)` Forms the union of the OptionSet with another. `func insert(Self.Element) -> (inserted: Bool, memberAfterInsert: Self.Element)` Inserts a new element into the OptionSet. `func intersection(Self) -> Self` Returns the intersection of the OptionSet with another. `func remove(Self.Element) -> Self.Element?` Removes an element from the OptionSet. `func symmetricDifference(Self) -> Self` Returns the symmetric difference of the OptionSet with another. `func union(Self) -> Self` Returns the union of the OptionSet with another. `func update(with: Self.Element) -> Self.Element?` Updates the OptionSet with a new element. ``` -------------------------------- ### init(method:) Source: https://sdwebimage.github.io/documentation/sdwebimage/sdwebimagedownloaderrequestmodifier-swift.class/init%28method%3A%29 Creates a request modifier with a specified HTTP method. If the method is nil, it defaults to GET. ```APIDOC ## init(method:) ### Description Creates the request modifier with HTTP Method. ### Method Signature ```swift init(method: String?) ``` ### Parameters #### Parameters - **method** (String?) - The HTTP Method for the request. If nil, it defaults to GET. ``` -------------------------------- ### Get Current Download Count Source: https://sdwebimage.github.io/documentation/sdwebimage/sdwebimagedownloader/currentdownloadcount Retrieve the current number of downloads that are still in progress. This is a read-only property. ```swift var currentDownloadCount: UInt { get } ``` -------------------------------- ### init(block:) Source: https://sdwebimage.github.io/documentation/sdwebimage/sdwebimagecachekeyfilter-swift.class/init%28block%3A%29 Initializes an SDWebImageCacheKeyFilter with a custom block for filtering cache keys. The block takes the original URL and the original cache key as input and returns the filtered cache key. ```APIDOC ## init(block:) ### Description Initializes an `SDWebImageCacheKeyFilter` instance using a provided block that defines custom logic for transforming cache keys. This allows for flexible cache management strategies. ### Method `init` ### Parameters #### Block Parameter - **block** (`@escaping SDWebImageCacheKeyFilterBlock`) - Required - A closure that takes the original URL and the original cache key as input and returns the modified cache key. This block is executed whenever a cache key needs to be generated or filtered. ``` -------------------------------- ### Instance Methods Source: https://sdwebimage.github.io/documentation/sdwebimage/sdwebimageoptions/setalgebra-implementations Explains the methods that can be called on SetAlgebra instances. ```APIDOC ## Instance Methods ### `func isDisjoint(with: Self) -> Bool` Checks if the current set is disjoint with another set. ### `func isStrictSubset(of: Self) -> Bool` Checks if the current set is a strict subset of another set. ### `func isStrictSuperset(of: Self) -> Bool` Checks if the current set is a strict superset of another set. ### `func isSubset(of: Self) -> Bool` Checks if the current set is a subset of another set. ### `func isSuperset(of: Self) -> Bool` Checks if the current set is a superset of another set. ### `func subtract(Self)` Removes elements from the current set that are also present in another set. ### `func subtracting(Self) -> Self` Returns a new set with elements from the current set that are not present in another set. ``` -------------------------------- ### Get Default SDImageCacheConfig Source: https://sdwebimage.github.io/documentation/sdwebimage/sdimagecacheconfig/default Retrieves the default cache configuration used by the shared image cache instance. ```swift class var `default`: SDImageCacheConfig { get } ``` -------------------------------- ### Get blurRadius Property Source: https://sdwebimage.github.io/documentation/sdwebimage/sdimageblurtransformer/blurradius Accesses the blur radius of the SDImageBlurTransformer. A value of 0 indicates no blur effect. ```swift var blurRadius: CGFloat { get } ``` -------------------------------- ### AnimatedImage Initializer with URL, Options, and Placeholder Source: https://sdwebimage.github.io/documentation/sdwebimageswiftui/animatedimage Creates an AnimatedImage with a URL, placeholder, custom options, and context, including a binding to control animation. ```swift init(url: URL?, options: SDWebImageOptions, context: [SDWebImageContextOption : Any]?, isAnimating: Binding, placeholder: () -> T) ``` -------------------------------- ### Get Current Graphics Context Source: https://sdwebimage.github.io/documentation/sdwebimage/sdgraphicsgetcurrentcontext%28%29 Returns the current graphics context. This function is part of the SDWebImage library. ```swift func SDGraphicsGetCurrentContext() -> CGContext? ``` -------------------------------- ### init(cachePath:config:) Source: https://sdwebimage.github.io/documentation/sdwebimage/sddiskcacheprotocol/init%28cachepath%3Aconfig%3A%29 Creates a new disk cache instance using a specified directory path and configuration. This initializer allows customization of cache behavior through `SDImageCacheConfig`, including `maxDiskSize` and `maxDiskAge`. ```APIDOC ## init(cachePath:config:) ### Description Creates a new disk cache based on the specified path and configuration. Allows checking `maxDiskSize` and `maxDiskAge` for disk cache behavior. ### Parameters #### Parameters - **cachePath** (String) - Required - Full path of a directory in which the cache will write data. Once initialized, you should not read and write to this directory. - **config** (SDImageCacheConfig) - Required - The cache config to be used to create the cache. ``` -------------------------------- ### SDImageScaleMode.fill Example Source: https://sdwebimage.github.io/documentation/sdwebimage/sdimagescalemode/fill Demonstrates the usage of the fill scale mode. This mode scales the content to fit the size of the view by changing the aspect ratio if necessary. ```swift case fill ``` -------------------------------- ### currentFrameIndex Source: https://sdwebimage.github.io/documentation/sdwebimage/sdanimatedimageview/currentframeindex Gets the current frame index of the animated image view. This property is zero-based and KVO compliant. ```APIDOC ## currentFrameIndex ### Description Gets the current frame index of the animated image view. This property is zero-based and KVO compliant. ### Property `@MainActor var currentFrameIndex: UInt { get }` ### Return Value The current frame index as a UInt. ``` -------------------------------- ### prefetchURLs(_:options:context:progress:completed:) Source: https://sdwebimage.github.io/documentation/sdwebimage/sdwebimageprefetcher/prefetchurls%28_%3Aoptions%3Acontext%3Aprogress%3Acompleted%3A%29 Assign list of URLs to let SDWebImagePrefetcher to queue the prefetching. It based on the image manager so the image may from the cache and network according to the `options` property. Prefetching is separate to each other, which means the progressBlock and completionBlock you provide is bind to the prefetching for the list of urls. Attention that call this will not cancel previous fetched urls. You should keep the token return by this to cancel or cancel all the prefetch. ```APIDOC ## Instance Method # prefetchURLs(_:options:context:progress:completed:) Assign list of URLs to let SDWebImagePrefetcher to queue the prefetching. It based on the image manager so the image may from the cache and network according to the `options` property. Prefetching is separate to each other, which means the progressBlock and completionBlock you provide is bind to the prefetching for the list of urls. Attention that call this will not cancel previous fetched urls. You should keep the token return by this to cancel or cancel all the prefetch. ```swift func prefetchURLs( _ urls: [URL]?, options: SDWebImageOptions = [], context: [SDWebImageContextOption : Any]?, progress progressBlock: SDWebImagePrefetcherProgressBlock?, completed completionBlock: SDWebImagePrefetcherCompletionBlock? = nil ) -> SDWebImagePrefetchToken? ``` ## Parameters `urls` List of URLs to prefetch `options` The options to use when downloading the image. @see SDWebImageOptions for the possible values. `context` A context contains different options to perform specify changes or processes, see `SDWebImageContextOption`. This hold the extra objects which `options` enum can not hold. `progressBlock` Block to be called when progress updates; first parameter is the number of completed (successful or not) requests, second parameter is the total number of images originally requested to be prefetched `completionBlock` Block to be called when the current prefetching is completed first param is the number of completed (successful or not) requests, second parameter is the number of skipped requests ## Return Value The token to cancel the current prefetching. ``` -------------------------------- ### SDAnimatedImageView maxBufferSize Property Source: https://sdwebimage.github.io/documentation/sdwebimage/sdanimatedimageview/maxbuffersize Declare the maxBufferSize property for SDAnimatedImageView. This property is an instance property that can be get and set. ```Objective-C @MainActor var maxBufferSize: UInt { get set } ``` -------------------------------- ### init(block:) Source: https://sdwebimage.github.io/documentation/sdwebimage/sdwebimagecacheserializer-swift.class/init%28block%3A%29 Initializes an SDWebImageCacheSerializer with a custom serialization block. This block is executed to determine how to serialize cache keys. ```APIDOC ## init(block:) ### Description Initializes an SDWebImageCacheSerializer with a custom serialization block. This block is executed to determine how to serialize cache keys. ### Method `init` (Initializer) ### Parameters #### Block Parameter - **block** (`@escaping SDWebImageCacheSerializerBlock`) - Required - A closure that takes a URL and an original key, and returns the serialized cache key. ``` -------------------------------- ### startAnimatingIndicator() Source: https://sdwebimage.github.io/documentation/sdwebimage/sdwebimageindicator/startanimatingindicator%28%29 Starts the animation for the indicator. This method is part of the SDWebImageIndicator framework and is used to initiate the visual animation of an indicator. ```APIDOC ## startAnimatingIndicator() ### Description Starts the animating for indicator. ### Method Instance Method ### Signature ```swift func startAnimatingIndicator() ``` ``` -------------------------------- ### SDWebImagePrefetcher Instance Methods Source: https://sdwebimage.github.io/documentation/sdwebimage/sdwebimageprefetcher Instance methods for managing the prefetching process. ```APIDOC ## Instance Methods ### `func cancelPrefetching()` Remove and cancel all the prefeching for the prefetcher. ### `func prefetchURLs([URL]?) -> SDWebImagePrefetchToken?` Assign list of URLs to let SDWebImagePrefetcher to queue the prefetching. It based on the image manager so the image may from the cache and network according to the `options` property. Prefetching is separate to each other, which means the progressBlock and completionBlock you provide is bind to the prefetching for the list of urls. Attention that call this will not cancel previous fetched urls. You should keep the token return by this to cancel or cancel all the prefetch. ### `func prefetchURLs([URL]?, options: SDWebImageOptions, context: [SDWebImageContextOption : Any]?, progress: SDWebImagePrefetcherProgressBlock?, completed: SDWebImagePrefetcherCompletionBlock?) -> SDWebImagePrefetchToken?` Assign list of URLs to let SDWebImagePrefetcher to queue the prefetching. It based on the image manager so the image may from the cache and network according to the `options` property. Prefetching is separate to each other, which means the progressBlock and completionBlock you provide is bind to the prefetching for the list of urls. Attention that call this will not cancel previous fetched urls. You should keep the token return by this to cancel or cancel all the prefetch. ### `func prefetchURLs([URL]?, progress: SDWebImagePrefetcherProgressBlock?, completed: SDWebImagePrefetcherCompletionBlock?) -> SDWebImagePrefetchToken?` Assign list of URLs to let SDWebImagePrefetcher to queue the prefetching. It based on the image manager so the image may from the cache and network according to the `options` property. Prefetching is separate to each other, which means the progressBlock and completionBlock you provide is bind to the prefetching for the list of urls. Attention that call this will not cancel previous fetched urls. You should keep the token return by this to cancel or cancel all the prefetch. ``` -------------------------------- ### Curl Down Transition Example Source: https://sdwebimage.github.io/documentation/sdwebimage/sdwebimagetransition Provides a curl-down transition effect for image loading. Use this for a page-curl like animation. ```swift SDWebImageTransition.curlDown ``` -------------------------------- ### Initializers Source: https://sdwebimage.github.io/documentation/sdwebimage/sdimagecacheoptions/setalgebra-implementations Provides details on how to initialize SetAlgebra types. ```APIDOC ## Initializers ### `init(S)` Initializes a new SetAlgebra instance from another SetAlgebra type. ### `init(arrayLiteral: Self.Element...)` Initializes a new SetAlgebra instance from an array literal. ``` -------------------------------- ### Get Colors in Rect Source: https://sdwebimage.github.io/documentation/sdwebimageswiftui/uikit/uiimage Extracts all UIColor values within a specified CGRect of the UIImage. This operation can be computationally intensive. ```swift func sd_colors(with: CGRect) -> [UIColor]? ``` -------------------------------- ### init(named:in:compatibleWith:) Source: https://sdwebimage.github.io/documentation/sdwebimage/sdanimatedimage-swift.class/init%28named%3Ain%3Acompatiblewith%3A%29 Initializes an SDAnimatedImage instance by loading an image from a bundle with specified compatibility traits. This is a convenience initializer. ```APIDOC ## init(named:in:compatibleWith:) ### Description Initializes an SDAnimatedImage instance by loading an image from a bundle with specified compatibility traits. This is a convenience initializer. ### Parameters #### Path Parameters - **name** (String) - Required - The name of the image resource. - **bundle** (Bundle?) - Optional - The bundle in which to search for the image resource. If nil, the main bundle is used. - **traitCollection** (UITraitCollection?) - Optional - The trait collection to use for image compatibility checks. ### Response #### Success Response - An initialized `SDAnimatedImage` instance, or `nil` if the image could not be found or initialized. ``` -------------------------------- ### Instance Methods Source: https://sdwebimage.github.io/documentation/sdwebimage/sdwebimagedownloaderoperation-swift.class Methods available on SDWebImageDownloaderOperation instances. ```APIDOC ## Instance Methods ### `func addHandlers(forProgress: SDWebImageDownloaderProgressBlock?, completed: SDWebImageDownloaderCompletedBlock?) -> Any?` Adds handlers for progress and completion. Returns a token that can be passed to -cancel: to cancel this set of callbacks. ### `func addHandlers(forProgress: SDWebImageDownloaderProgressBlock?, completed: SDWebImageDownloaderCompletedBlock?, decodeOptions: [SDImageCoderOption : Any]?) -> Any?` Adds handlers for progress and completion, and optional decode options (which need another image other than the initial one). Returns a token that can be passed to -cancel: to cancel this set of callbacks. ### `func cancel(Any?) -> Bool` Cancels a set of callbacks. Once all callbacks are canceled, the operation is cancelled. ``` -------------------------------- ### currentFrame Property Declaration Source: https://sdwebimage.github.io/documentation/sdwebimageswiftui/imageplayer/currentframe This snippet shows the declaration of the `currentFrame` property, which is a published optional `PlatformImage` that can be get and set. ```swift @Published var currentFrame: PlatformImage? { get set } ``` -------------------------------- ### SDWebImagePrefetcher Initializers Source: https://sdwebimage.github.io/documentation/sdwebimage/sdwebimageprefetcher Initializers for the SDWebImagePrefetcher class. ```APIDOC ## Initializers ### `init(imageManager: SDWebImageManager)` Allows you to instantiate a prefetcher with any arbitrary image manager. ``` -------------------------------- ### Get Cache Key for URL Source: https://sdwebimage.github.io/documentation/sdwebimage/sdwebimagemanager Generates a cache key for a given URL, used internally for cache lookups. ```APIDOC ## Instance Method: cacheKey(for:) ### Description Returns the cache key for a given URL. This method does not consider transformers or thumbnail options. ### Method Signature `func cacheKey(for url: URL?) -> String?` ### Parameters - **url** (URL?) - The URL for which to generate a cache key. ### Returns `String?` - The generated cache key, or nil if the URL is nil. ### Example ```swift let imageUrl = URL(string: "https://example.com/image.jpg") let cacheKey = SDWebImageManager.shared.cacheKey(for: imageUrl) ``` ``` -------------------------------- ### SDWebImageError.Code.blackListed Property Source: https://sdwebimage.github.io/documentation/sdwebimage/sdwebimageerror-swift.struct/blacklisted Access the `blackListed` static property to get the error code for blacklisted URLs. This is a read-only property. ```swift static var blackListed: SDWebImageError.Code { get } ``` -------------------------------- ### Set Image with URL, Placeholder, Options, and Context Source: https://sdwebimage.github.io/documentation/sdwebimageswiftui/uikit/uiimageview Load an image from a URL with a placeholder, custom options, and a context dictionary for advanced configuration. This method allows for fine-grained control over image loading. ```swift func sd_setImage(with: URL?, placeholderImage: UIImage?, options: SDWebImageOptions, context: [SDWebImageContextOption : Any]?) ``` -------------------------------- ### init(headers:) Source: https://sdwebimage.github.io/documentation/sdwebimage/sdwebimagedownloaderrequestmodifier-swift.class/init%28headers%3A%29 Initializes a new SDWebImageDownloaderRequestModifier with the specified HTTP headers. These headers will override any existing headers in the original request. ```APIDOC ## init(headers:) ### Description Creates the request modifier with HTTP Headers. ### Parameters #### Parameters - **headers** ([String: String]?) - HTTP Headers. Case insensitive according to HTTP/1.1(HTTP/2) standard. The headers will override the same fields from original request. ``` -------------------------------- ### Get HTTP Header Field Value Source: https://sdwebimage.github.io/documentation/sdwebimage/sdwebimagedownloader Retrieves the value of a specified HTTP header field from the download requests. ```swift func value(forHTTPHeaderField: String?) -> String? ``` -------------------------------- ### init() Source: https://sdwebimage.github.io/documentation/sdwebimage/sdgraphicsimagerendererformat/init%28%29 Initializes the default format for SDGraphicsImageRendererFormat. All properties will be set to their default values. ```APIDOC ## init() ### Description Initializes the default format for SDGraphicsImageRendererFormat. All properties will be set to their default values. ### Method init() ### Parameters None ### Response Initializes an SDGraphicsImageRendererFormat object with default settings. ```