ImagePickerPreviewController

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

Undocumented

  • Undocumented

    Declaration

    Swift

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

    Declaration

    Swift

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

    Declaration

    Swift

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

    Declaration

    Swift

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

    Declaration

    Swift

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

    Declaration

    Swift

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

    Declaration

    Swift

    open var bottomToolbarHeight: CGFloat { get set }
  • Undocumented

    Declaration

    Swift

    open var checkboxImage: UIImage?
  • Undocumented

    Declaration

    Swift

    open var checkboxCheckedImage: UIImage?
  • Undocumented

    Declaration

    Swift

    open var originImageCheckboxImage: UIImage?
  • Undocumented

    Declaration

    Swift

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

    Declaration

    Swift

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

    Declaration

    Swift

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

    Declaration

    Swift

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

    Declaration

    Swift

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

    Declaration

    Swift

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

    Declaration

    Swift

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

    Declaration

    Swift

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

    Declaration

    Swift

    open var imagesAssetArray: [Asset]
  • Undocumented

    Declaration

    Swift

    open var selectedImageAssetArray: [Asset]
  • Undocumented

    Declaration

    Swift

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

    Declaration

    Swift

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

    Declaration

    Swift

    open var minimumSelectImageCount: UInt
  • Undocumented

    Declaration

    Swift

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

    Declaration

    Swift

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

    Declaration

    Swift

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

    Declaration

    Swift

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

    Declaration

    Swift

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

    Declaration

    Swift

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

    Declaration

    Swift

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

    Declaration

    Swift

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

    Declaration

    Swift

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

    Declaration

    Swift

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

    Declaration

    Swift

    public required init?(coder: NSCoder)
  • Undocumented

    Declaration

    Swift

    open override func viewDidLoad()
  • Undocumented

    Declaration

    Swift

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

    Declaration

    Swift

    open override func viewDidLayoutSubviews()
  • Undocumented

    Declaration

    Swift

    open override var prefersStatusBarHidden: Bool { get }
  • 更新数据并刷新 UI,手工调用

    Declaration

    Swift

    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

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

    Declaration

    Swift

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

    Declaration

    Swift

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

    Declaration

    Swift

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

    Declaration

    Swift

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

ImagePreviewViewDelegate