ImagePickerController
@MainActor
open class ImagePickerController : UIViewController, UICollectionViewDataSource, UICollectionViewDelegate, UICollectionViewDelegateFlowLayout, ImagePickerPreviewControllerDelegate, ImagePickerTitleViewDelegate
Undocumented
-
Undocumented
Declaration
Swift
@MainActor open weak var imagePickerControllerDelegate: ImagePickerControllerDelegate?
-
自定义预览控制器句柄,优先级低于delegate
Declaration
Swift
@MainActor open var previewControllerBlock: (() -> ImagePickerPreviewController)?
-
自定义相册控制器句柄,优先级低于delegate
Declaration
Swift
@MainActor open var albumControllerBlock: (() -> ImageAlbumController)?
-
自定义cell展示句柄,cellForItem自动调用,优先级低于delegate
Declaration
Swift
@MainActor open var customCellBlock: ((_ cell: ImagePickerCollectionCell, _ indexPath: IndexPath) -> Void)?
-
图片选取完成回调句柄,优先级低于delegate
Declaration
Swift
@MainActor open var didFinishPicking: (([Asset]) -> Void)?
-
图片选取取消回调句柄,优先级低于delegate
Declaration
Swift
@MainActor open var didCancelPicking: (() -> Void)?
-
Undocumented
Declaration
Swift
@MainActor open var toolbarBackgroundColor: UIColor? { get set }
-
Undocumented
Declaration
Swift
@MainActor open var toolbarTintColor: UIColor? { get set }
-
标题视图accessoryImage,默认nil,contentType方式会自动设置
Declaration
Swift
@MainActor open var titleAccessoryImage: UIImage?
-
图片的最小尺寸,布局时如果有剩余空间,会将空间分配给图片大小,所以最终显示出来的大小不一定等于minimumImageWidth。默认是75。 collectionViewLayout 和 collectionView 可能有设置 sectionInsets 和 contentInsets,所以设置几行不可以简单的通过 screenWdith / columnCount 来获得
Declaration
Swift
@MainActor open var minimumImageWidth: CGFloat { get set }
-
图片显示列数,默认0使用minimumImageWidth自动计算,指定后固定列数
Declaration
Swift
@MainActor open var imageColumnCount: Int { get set }
-
Undocumented
Declaration
Swift
@MainActor open var toolbarPaddingHorizontal: CGFloat
-
自定义工具栏高度,默认同系统
Declaration
Swift
@MainActor open var operationToolbarHeight: CGFloat { get set }
-
Undocumented
Declaration
Swift
@MainActor open private(set) var imagesAssetArray: [Asset] { get }
-
Undocumented
Declaration
Swift
@MainActor open private(set) var assetsGroup: AssetGroup? { get }
-
图片过滤类型,默认0不过滤,影响requestImage结果和previewController预览效果
Declaration
Swift
@MainActor open var filterType: ImagePickerFilterType
-
自定义视频导出质量,默认nil时为AVAssetExportPresetMediumQuality
Declaration
Swift
@MainActor open var videoExportPreset: String?
-
是否视频导出为AVAsset,默认false
Declaration
Swift
@MainActor open var videoExportAVAsset: Bool
-
当前被选择的图片对应的 Asset 对象数组
Declaration
Swift
@MainActor open internal(set) var selectedImageAssetArray: [Asset] { get }
-
是否允许图片多选,默认为 YES。如果为 NO,则不显示 checkbox 和底部工具栏
Declaration
Swift
@MainActor open var allowsMultipleSelection: Bool { get set }
-
是否禁用预览时左右滚动,默认NO。如果为YES,单选时不能左右滚动切换图片
Declaration
Swift
@MainActor open var previewScrollDisabled: Bool
-
最多可以选择的图片数,默认为9
Declaration
Swift
@MainActor open var maximumSelectImageCount: UInt
-
最少需要选择的图片数,默认为 0
Declaration
Swift
@MainActor open var minimumSelectImageCount: UInt
-
是否显示默认loading,优先级低于delegate,默认YES
Declaration
Swift
@MainActor open var showsDefaultLoading: Bool
-
是否需要请求图片资源,默认NO,开启后会先requestImagesAssetArray再回调didFinishPicking
Declaration
Swift
@MainActor open var shouldRequestImage: Bool
-
当前titleView,默认不可点击,contentType方式会自动切换点击状态
Declaration
Swift
@MainActor open lazy var titleView: ImagePickerTitleView { get set }
-
Undocumented
Declaration
Swift
@MainActor open lazy var collectionView: UICollectionView { get set }
-
Undocumented
Declaration
Swift
@MainActor open lazy var collectionViewLayout: UICollectionViewFlowLayout { get set }
-
Undocumented
Declaration
Swift
@MainActor open lazy var operationToolbarView: UIView { get set }
-
Undocumented
Declaration
Swift
@MainActor open lazy var sendButton: UIButton { get set }
-
Undocumented
Declaration
Swift
@MainActor open lazy var previewButton: UIButton { 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 }
-
图片过滤类型转换为相册内容类型
Declaration
Swift
@MainActor open class func albumContentType(filterType: ImagePickerFilterType) -> AlbumContentType
-
requestImagesAssetArray(_:
filterType: useOriginImage: videoExportPreset: videoExportAVAsset: completion: ) 检查并下载一组资源,如果资源仍未从 iCloud 中成功下载,则会发出请求从 iCloud 加载资源,下载完成后,主线程回调。 图片资源对象和结果信息保存在Asset.requestObject,自动根据过滤类型返回UIImage|PHLivePhoto|NSURL
Declaration
Swift
@MainActor open class func requestImagesAssetArray( _ imagesAssetArray: [Asset], filterType: ImagePickerFilterType, useOriginImage: Bool, videoExportPreset: String? = nil, videoExportAVAsset: Bool = false, completion: (@MainActor @Sendable () -> Void)? )
-
也可以直接传入 AssetGroup,然后读取其中的 Asset 并储存到 imagesAssetArray 中,传入后会赋值到 AssetGroup,并自动刷新 UI 展示
Declaration
Swift
@MainActor open func refresh(assetsGroup: AssetGroup?)
-
根据filterType刷新,自动选取第一个符合条件的相册,自动初始化并使用albumController
Declaration
Swift
@MainActor open func refresh(filterType: ImagePickerFilterType)
-
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)
-
Undocumented
Declaration
Swift
@MainActor open func didTouchTitleView(_ titleView: ImagePickerTitleView, isActive: Bool)
-
Undocumented
Declaration
Swift
@MainActor open func didChangedActive(_ active: Bool, for titleView: ImagePickerTitleView)