ImagePlugin
public protocol ImagePlugin : AnyObject
图片插件协议,应用可自定义图片插件
-
animatedImageView()
Default implementation创建动画视图插件方法,默认使用UIImageView
Default Implementation
创建动画视图插件方法,默认使用UIImageView
Declaration
Swift
@MainActor func animatedImageView() -> UIImageView
-
imageURL(for:
Default implementation) 获取view正在加载的URL插件方法
Default Implementation
获取view正在加载的URL插件方法
Declaration
Swift
@MainActor func imageURL(for view: UIView) -> URL?
-
setImageURL(url:
Default implementationplaceholder: options: context: setImageBlock: completion: progress: for: ) view加载网络图片插件方法
Default Implementation
view加载网络图片插件方法
Declaration
Swift
@MainActor func setImageURL( url: URL?, placeholder: UIImage?, options: WebImageOptions, context: [ImageCoderOptions: Any]?, setImageBlock: (@MainActor @Sendable (UIImage?) -> Void)?, completion: (@MainActor @Sendable (UIImage?, Error?) -> Void)?, progress: (@MainActor @Sendable (Double) -> Void)?, for view: UIView )
-
cancelImageRequest(for:
Default implementation) view取消加载网络图片请求插件方法
Default Implementation
view取消加载网络图片请求插件方法
Declaration
Swift
@MainActor func cancelImageRequest(for view: UIView)
-
loadImageCache(_:
Default implementation) 加载指定URL的本地缓存图片
Default Implementation
加载指定URL的本地缓存图片
Declaration
Swift
func loadImageCache(_ imageURL: URL?) -> UIImage?
-
clearImageCaches(_:
Default implementation) 清除所有本地图片缓存
Default Implementation
清除所有本地图片缓存
Declaration
Swift
func clearImageCaches(_ completion: (@MainActor @Sendable () -> Void)?)
-
downloadImage(_:
Default implementationoptions: context: completion: progress: ) image下载网络图片插件方法,返回下载凭据
Default Implementation
image下载网络图片插件方法,返回下载凭据
Declaration
Swift
func downloadImage( _ imageURL: URL?, options: WebImageOptions, context: [ImageCoderOptions: Any]?, completion: @escaping @MainActor @Sendable (UIImage?, Data?, Error?) -> Void, progress: (@MainActor @Sendable (Double) -> Void)? ) -> Any?
-
cancelImageDownload(_:
Default implementation) image取消下载网络图片插件方法,指定下载凭据
Default Implementation
image取消下载网络图片插件方法,指定下载凭据
Declaration
Swift
func cancelImageDownload(_ receipt: Any?)
-
imageDecode(_:
Default implementationscale: options: ) image本地解码插件方法,默认使用系统方法
Default Implementation
image本地解码插件方法,默认使用系统方法
Declaration
Swift
func imageDecode( _ data: Data, scale: CGFloat, options: [ImageCoderOptions: Any]? ) -> UIImage?
-
imageEncode(_:
Default implementationoptions: ) image本地编码插件方法,默认使用系统方法
Default Implementation
image本地编码插件方法,默认使用系统方法
Declaration
Swift
func imageEncode( _ image: UIImage, options: [ImageCoderOptions: Any]? ) -> Data?