ImagePreviewPlugin
@MainActor
public protocol ImagePreviewPlugin : AnyObject
图片预览插件协议,应用可自定义图片预览插件实现
-
showImagePreview(imageURLs:
Default implementationimageInfos: currentIndex: sourceView: placeholderImage: renderBlock: customBlock: in: ) 显示图片预览方法
Default Implementation
显示图片预览方法
Declaration
Swift
@MainActor func showImagePreview( imageURLs: [Any], imageInfos: [Any]?, currentIndex: Int, sourceView: (@MainActor @Sendable (Int) -> Any?)?, placeholderImage: (@MainActor @Sendable (Int) -> UIImage?)?, renderBlock: (@MainActor @Sendable (UIView, Int) -> Void)?, customBlock: (@MainActor @Sendable (Any) -> Void)?, in viewController: UIViewController )
Parameters
imageURLs
预览图片列表,支持NSString|UIImage|PHLivePhoto|AVPlayerItem类型
imageInfos
自定义图片信息数组
currentIndex
当前索引,默认0
sourceView
来源视图句柄,支持UIView|NSValue.CGRect,默认nil
placeholderImage
占位图或缩略图句柄,默认nil
renderBlock
自定义渲染句柄,默认nil
customBlock
自定义配置句柄,默认nil
viewController
当前视图控制器