ImagePickerPluginImpl

@MainActor
open class ImagePickerPluginImpl : NSObject, ImagePickerPlugin, @unchecked Sendable

默认图片选取插件

Accessor

  • 单例模式

    Declaration

    Swift

    @objc(sharedInstance)
    @MainActor
    public static let shared: ImagePickerPluginImpl
  • 是否禁用iOS14+PHPickerViewController(支持多选、无需用户隐私授权),默认false。设为true后始终使用UIImagePickerController(仅支持单选)

    Declaration

    Swift

    @MainActor
    open var photoPickerDisabled: Bool
  • 是否启用iOS14+PHPickerViewController导航栏控制器,默认false。注意设为true后customBlock参数将变为UINavigationController

    Declaration

    Swift

    @MainActor
    open var photoNavigationEnabled: Bool
  • 编辑单张图片时是否启用自定义裁剪控制器,默认false,使用系统方式

    Declaration

    Swift

    @MainActor
    open var cropControllerEnabled: Bool
  • 是否全屏弹出,默认false,使用系统方式

    Declaration

    Swift

    @MainActor
    open var presentationFullScreen: Bool
  • 自定义图片裁剪控制器句柄,启用自定义裁剪后生效

    Declaration

    Swift

    @MainActor
    open var cropControllerBlock: (@MainActor @Sendable (UIImage) -> ImageCropController)?
  • 自定义视频质量,默认nil时不生效

    Declaration

    Swift

    @MainActor
    open var videoQuality: UIImagePickerController.QualityType?
  • 自定义PHPicker导出进度句柄,主线程回调,默认nil

    Declaration

    Swift

    @MainActor
    open var exportProgressBlock: (@MainActor @Sendable (_ controller: UIViewController, _ finishedCount: Int, _ totalCount: Int) -> Void)?
  • 图片选取全局自定义句柄,show方法自动调用

    Declaration

    Swift

    @MainActor
    open var customBlock: (@MainActor @Sendable (UIViewController) -> Void)?

ImagePickerPlugin