ImagePickerPlugin
@MainActor
public protocol ImagePickerPlugin : AnyObject
图片选取插件协议,应用可自定义图片选取插件实现
-
showImageCamera(filterType:
Default implementationallowsEditing: customBlock: completion: in: ) 从Camera选取单张图片插件方法
Default Implementation
从Camera选取单张图片插件方法
Declaration
Swift
@MainActor func showImageCamera( filterType: ImagePickerFilterType, allowsEditing: Bool, customBlock: (@MainActor @Sendable (Any) -> Void)?, completion: @escaping @MainActor @Sendable (Any?, Any?, Bool) -> Void, in viewController: UIViewController )
Parameters
filterType
过滤类型,默认0同系统
allowsEditing
是否允许编辑
customBlock
自定义配置句柄,默认nil
completion
完成回调,主线程。参数1为对象(UIImage|PHLivePhoto|NSURL),2为结果信息,3为是否取消
viewController
当前视图控制器
-
showImagePicker(filterType:
Default implementationselectionLimit: allowsEditing: customBlock: completion: in: ) 从图片库选取多张图片插件方法
Default Implementation
从图片库选取多张图片插件方法
Declaration
Swift
@MainActor func showImagePicker( filterType: ImagePickerFilterType, selectionLimit: Int, allowsEditing: Bool, customBlock: (@MainActor @Sendable (Any) -> Void)?, completion: @escaping @MainActor @Sendable ([Any], [Any], Bool) -> Void, in viewController: UIViewController )
Parameters
filterType
过滤类型,默认0同系统
selectionLimit
最大选择数量
allowsEditing
是否允许编辑
customBlock
自定义配置句柄,默认nil
completion
完成回调,主线程。参数1为对象数组(UIImage|PHLivePhoto|NSURL),2位结果数组,3为是否取消
viewController
当前视图控制器