ImagePluginImpl
open class ImagePluginImpl : NSObject, ImagePlugin, @unchecked Sendable
默认图片插件
-
单例模式
Declaration
Swift
@objc(sharedInstance) public static let shared: ImagePluginImpl
-
图片加载完成是否显示渐变动画,默认false
Declaration
Swift
open var fadeAnimated: Bool
-
图片加载时是否显示动画指示器,默认false
Declaration
Swift
open var showsIndicator: Bool
-
图片占位图存在时是否隐藏动画指示器,默认false
Declaration
Swift
open var hidesPlaceholderIndicator: Bool
-
自定义动画指示器句柄,参数为是否有placeholder,默认nil
Declaration
Swift
open var customIndicatorBlock: (@MainActor @Sendable (UIView, Bool) -> (UIView & IndicatorViewPlugin)?)?
-
自定义图片处理句柄,setImageURL开始时调用
Declaration
Swift
open var customBlock: (@MainActor @Sendable (UIView) -> Void)?
-
自定义图片进度句柄,setImageURL下载时调用
Declaration
Swift
open var customProgressBlock: (@MainActor @Sendable (UIView, CGFloat) -> Void)?
-
自定义图片完成句柄,setImageURL完成时调用
Declaration
Swift
open var customCompletionBlock: (@MainActor @Sendable (UIView, UIImage?, Error?) -> Void)?
-
自定义图片取消句柄,cancelImageRequest时调用
Declaration
Swift
open var customCancelBlock: (@MainActor @Sendable (UIView) -> Void)?
-
Declaration
Swift
@MainActor open func animatedImageView() -> UIImageView
-
Declaration
Swift
open func imageDecode( _ data: Data, scale: CGFloat, options: [ImageCoderOptions: Any]? = nil ) -> UIImage?
-
Declaration
Swift
open func imageEncode( _ image: UIImage, options: [ImageCoderOptions: Any]? = nil ) -> Data?
-
Declaration
Swift
@MainActor open func imageURL(for view: UIView) -> URL?
-
Declaration
Swift
@MainActor open func setImageURL( url imageURL: URL?, placeholder: UIImage?, options: WebImageOptions = [], context: [ImageCoderOptions: Any]?, setImageBlock block: (@MainActor @Sendable (UIImage?) -> Void)?, completion: (@MainActor @Sendable (UIImage?, Error?) -> Void)?, progress: (@MainActor @Sendable (Double) -> Void)? = nil, for view: UIView )
-
Declaration
Swift
@MainActor open func cancelImageRequest(for view: UIView)
-
Declaration
Swift
open func loadImageCache(_ imageURL: URL?) -> UIImage?
-
Declaration
Swift
open func clearImageCaches(_ completion: (@MainActor @Sendable () -> Void)? = nil)
-
Declaration
Swift
open func downloadImage( _ imageURL: URL?, options: WebImageOptions = [], context: [ImageCoderOptions: Any]?, completion: @escaping @MainActor @Sendable (UIImage?, Data?, Error?) -> Void, progress: (@MainActor @Sendable (Double) -> Void)? = nil ) -> Any?
-
Declaration
Swift
open func cancelImageDownload(_ receipt: Any?)