ImagePickerPreviewController

@MainActor
open class ImagePickerPreviewController : ImagePreviewController, UICollectionViewDataSource, UICollectionViewDelegate, UICollectionViewDelegateFlowLayout, ImagePreviewViewDelegate

Undocumented

  • Undocumented

    Declaration

    Swift

    @MainActor
    open weak var delegate: ImagePickerPreviewControllerDelegate?
  • 自定义裁剪控制器句柄,优先级低于delegate

    Declaration

    Swift

    @MainActor
    open var cropControllerBlock: ((UIImage) -> ImageCropController)?
  • 自定义cell展示句柄,cellForItem自动调用,优先级低于delegate

    Declaration

    Swift

    @MainActor
    open var customCellBlock: ((_ cell: ImagePickerPreviewCollectionCell, _ indexPath: IndexPath) -> Void)?
  • Undocumented

    Declaration

    Swift

    @MainActor
    open var toolbarBackgroundColor: UIColor? { get set }
  • Undocumented

    Declaration

    Swift

    @MainActor
    open var toolbarTintColor: UIColor? { get set }
  • Undocumented

    Declaration

    Swift

    @MainActor
    open var toolbarPaddingHorizontal: CGFloat
  • 自定义底部工具栏高度,默认同系统

    Declaration

    Swift

    @MainActor
    open var bottomToolbarHeight: CGFloat { get set }
  • Undocumented

    Declaration

    Swift

    @MainActor
    open var checkboxImage: UIImage?
  • Undocumented

    Declaration

    Swift

    @MainActor
    open var checkboxCheckedImage: UIImage?
  • Undocumented

    Declaration

    Swift

    @MainActor
    open var originImageCheckboxImage: UIImage?
  • Undocumented

    Declaration

    Swift

    @MainActor
    open var originImageCheckboxCheckedImage: UIImage?
  • 是否使用原图,默认NO

    Declaration

    Swift

    @MainActor
    open var shouldUseOriginImage: Bool
  • 是否显示原图按钮,默认NO

    Declaration

    Swift

    @MainActor
    open var showsOriginImageCheckboxButton: Bool { get set }
  • 是否显示编辑按钮,默认YES

    Declaration

    Swift

    @MainActor
    open var showsEditButton: Bool { get set }
  • 是否显示编辑collectionView,默认YES,仅多选生效

    Declaration

    Swift

    @MainActor
    open var showsEditCollectionView: Bool
  • 编辑collectionView总高度,默认80

    Declaration

    Swift

    @MainActor
    open var editCollectionViewHeight: CGFloat
  • 编辑collectionCell大小,默认(60, 60)

    Declaration

    Swift

    @MainActor
    open var editCollectionCellSize: CGSize
  • 是否显示默认loading,优先级低于delegate,默认YES

    Declaration

    Swift

    @MainActor
    open var showsDefaultLoading: Bool
  • 由于组件需要通过本地图片的 Asset 对象读取图片的详细信息,因此这里的需要传入的是包含一个或多个 Asset 对象的数组

    Declaration

    Swift

    @MainActor
    open var imagesAssetArray: [Asset]
  • Undocumented

    Declaration

    Swift

    @MainActor
    open var selectedImageAssetArray: [Asset]
  • Undocumented

    Declaration

    Swift

    @MainActor
    open var downloadStatus: AssetDownloadStatus { get set }
  • 最多可以选择的图片数,默认为9

    Declaration

    Swift

    @MainActor
    open var maximumSelectImageCount: UInt
  • 最少需要选择的图片数,默认为 0

    Declaration

    Swift

    @MainActor
    open var minimumSelectImageCount: UInt
  • Undocumented

    Declaration

    Swift

    @MainActor
    open lazy var topToolbarView: UIView { get set }
  • Undocumented

    Declaration

    Swift

    @MainActor
    open lazy var backButton: UIButton { get set }
  • Undocumented

    Declaration

    Swift

    @MainActor
    open lazy var checkboxButton: UIButton { get set }
  • Undocumented

    Declaration

    Swift

    @MainActor
    open lazy var bottomToolbarView: UIView { get set }
  • Undocumented

    Declaration

    Swift

    @MainActor
    open lazy var sendButton: UIButton { get set }
  • Undocumented

    Declaration

    Swift

    @MainActor
    open lazy var editButton: UIButton { get set }
  • Undocumented

    Declaration

    Swift

    @MainActor
    open lazy var originImageCheckboxButton: UIButton { get set }
  • Undocumented

    Declaration

    Swift

    @MainActor
    open lazy var editCollectionViewLayout: UICollectionViewFlowLayout { get set }
  • Undocumented

    Declaration

    Swift

    @MainActor
    open lazy var editCollectionView: UICollectionView { get set }
  • Undocumented

    Declaration

    Swift

    @MainActor
    override public init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?)
  • Undocumented

    Declaration

    Swift

    @MainActor
    public required init?(coder: NSCoder)
  • Undocumented

    Declaration

    Swift

    @MainActor
    override open func viewDidLoad()
  • Undocumented

    Declaration

    Swift

    @MainActor
    override open func viewWillAppear(_ animated: Bool)
  • Undocumented

    Declaration

    Swift

    @MainActor
    override open func viewDidLayoutSubviews()
  • Undocumented

    Declaration

    Swift

    @MainActor
    override open var prefersStatusBarHidden: Bool { get }
  • Undocumented

    Declaration

    Swift

    @MainActor
    override open var preferredStatusBarStyle: UIStatusBarStyle { get }
  • 更新数据并刷新 UI,手工调用

    Declaration

    Swift

    @MainActor
    open func updateImagePickerPreviewView(
        imageAssetArray: [Asset],
        selectedImageAssetArray: [Asset],
        currentImageIndex: Int,
        singleCheckMode: Bool,
        previewMode: Bool
    )

    Parameters

    imageAssetArray

    包含所有需要展示的图片的数组

    selectedImageAssetArray

    包含所有需要展示的图片中已经被选中的图片的数组

    currentImageIndex

    当前展示的图片在 imageAssetArray 的索引

    singleCheckMode

    是否为单选模式,如果是单选模式,则不显示 checkbox

    previewMode

    是否是预览模式,如果是预览模式,图片取消选中时editCollectionView会置灰而不是隐藏

UICollectionView

  • Undocumented

    Declaration

    Swift

    @MainActor
    open func numberOfSections(in collectionView: UICollectionView) -> Int
  • Undocumented

    Declaration

    Swift

    @MainActor
    open func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int
  • Undocumented

    Declaration

    Swift

    @MainActor
    open func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize
  • Undocumented

    Declaration

    Swift

    @MainActor
    open func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell
  • Undocumented

    Declaration

    Swift

    @MainActor
    open func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath)

ImagePreviewViewDelegate