ImageAlbumController

open class ImageAlbumController : UIViewController, UITableViewDataSource, UITableViewDelegate

当前设备照片里的相簿列表

使用方式:

  1. 使用 init 初始化。
  2. 指定一个 albumControllerDelegate,并实现 @required 方法。

注意,iOS 访问相册需要得到授权,建议先询问用户授权([AssetsManager requestAuthorization:]),通过了再进行 ImageAlbumController 的初始化工作。

  • 工具栏背景色

    Declaration

    Swift

    open var toolbarBackgroundColor: UIColor? { get set }
  • 工具栏颜色

    Declaration

    Swift

    open var toolbarTintColor: UIColor? { get set }
  • 相册列表 cell 的高度,同时也是相册预览图的宽高,默认76

    Declaration

    Swift

    open var albumTableViewCellHeight: CGFloat
  • 相册列表视图最大高度,默认0不限制

    Declaration

    Swift

    open var maximumTableViewHeight: CGFloat
  • 相册列表附加显示高度,当内容高度小于最大高度时生效,默认0

    Declaration

    Swift

    open var additionalTableViewHeight: CGFloat
  • 当前相册列表实际显示高度,只读

    Declaration

    Swift

    open var tableViewHeight: CGFloat { get }
  • 当前相册列表,异步加载

    Declaration

    Swift

    open private(set) var albumsArray: [AssetGroup] { get }
  • 相册列表事件代理

    Declaration

    Swift

    open weak var albumControllerDelegate: ImageAlbumControllerDelegate?
  • 自定义pickerController句柄,优先级低于delegate

    Declaration

    Swift

    open var pickerControllerBlock: (() -> ImagePickerController)?
  • 自定义cell展示句柄,cellForRow自动调用,优先级低于delegate

    Declaration

    Swift

    open var customCellBlock: ((ImageAlbumTableCell, IndexPath) -> Void)?
  • 相册列表默认封面图,默认nil

    Declaration

    Swift

    open var defaultPosterImage: UIImage?
  • 相册展示内容的类型,可以控制只展示照片、视频或音频的其中一种,也可以同时展示所有类型的资源,默认展示所有类型的资源。

    Declaration

    Swift

    open var contentType: AlbumContentType
  • 当前选中相册,默认nil

    Declaration

    Swift

    open internal(set) var assetsGroup: AssetGroup? { get set }
  • 是否显示默认loading,优先级低于delegate,默认YES

    Declaration

    Swift

    open var showsDefaultLoading: Bool
  • 是否直接进入第一个相册列表,默认NO

    Declaration

    Swift

    open var pickDefaultAlbumGroup: Bool
  • 背景视图,可设置背景色,添加点击手势等

    Declaration

    Swift

    open lazy var backgroundView: UIView { get set }
  • 相册只读列表视图

    Declaration

    Swift

    open lazy var tableView: UITableView { 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 }
  • Undocumented

    Declaration

    Swift

    open override var preferredStatusBarStyle: UIStatusBarStyle { get }

UITableView

  • Undocumented

    Declaration

    Swift

    open func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int
  • Undocumented

    Declaration

    Swift

    open func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat
  • Undocumented

    Declaration

    Swift

    open func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell
  • Undocumented

    Declaration

    Swift

    open func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath)