-
Notifications
You must be signed in to change notification settings - Fork 4
ADAssetListDataSource
The data source of asset model controller. It get assets you request and reload the associate reloadable view when assets changed.
public class ADAssetListDataSource: NSObject
NSObject
, PHPhotoLibraryChangeObserver
Create data source with associate reloadable view, album model, select assets and options.
public init(reloadable: ADDataSourceReloadable,
album: ADAlbumModel,
selects: [PHAsset],
albumOpts: ADAlbumSelectOptions,
assetOpts: ADAssetSelectOptions)
- reloadable: Associate reloadable view.
- album: Album to get assets.
- selects: Selected assets.
- albumOpts: Options to limit album type and order. It is
ADAlbumSelectOptions.default
by default. - assetOpts: Options to control the asset select condition and ui. It is
ADAssetSelectOptions.default
by default.
Create data source with associate reloadable view, album model, select assets and options.
public init(reloadable: ADDataSourceReloadable,
album: ADAlbumModel,
selects: [ADSelectAssetModel],
albumOpts: ADAlbumSelectOptions,
assetOpts: ADAssetSelectOptions)
- reloadable: Associate reloadable view.
- album: Album to get assets.
- selects: Selected asset models.
- albumOpts: Options to limit album type and order. It is
ADAlbumSelectOptions.default
by default. - assetOpts: Options to control the asset select condition and ui. It is
ADAssetSelectOptions.default
by default.
The associate reloadable view conform to ADDataSourceReloadable
.
public weak var reloadable: ADDataSourceReloadable?
Options to set the album type and order.
public let albumOpts: ADAlbumSelectOptions
Options to control the asset select condition and ui.
public let assetOpts: ADAssetSelectOptions
The album select to get assets.
public let album: ADAlbumModel
Assets array request from album.
public var list: [ADAssetModel] = []
Assets you select.
public var selects: [ADSelectAssetModel] = []
The cell count except assets.
public var appendCellCount: Int
Indicate whether show camera cell in CameraRoll. if true
, camera roll page will show camera cell.
public var enableCameraCell: Bool
The index for camera cell.
public var cameraCellIndex: Int
Indicate whether show add asset in CameraRoll when user choose limited Photo mode. if true
, camera roll page will show add asset cell.
@available(iOS 14, *)
public var enableAddAssetCell: Bool
The index for add seest cell.
public var addAssetCellIndex: Int
Called when select asset or deselect asset.
public var selectAssetChanged: ((Int)->Void)?
Reload the associate view with fetch assets.
public func reloadData(completion: (() -> Void)? = nil)
- completion: Called when the reload finished.
Return modify indexPath when camera cell or add asset cell is enable.
public func modifyIndexPath(_ indexPath: IndexPath) -> IndexPath
- indexPath: Orginal indexPath.
Modify indexPath.
Select the asset.
public func selectAssetAt(index: Int)
- index: Index whitch asset is select.
Deselect the asset.
public func deselectAssetAt(index: Int)
- index: Index whitch asset is deselect.
Reload asset selectStatus
with select indexs. Use this method when return from browser controller.
public func reloadSelectAssetIndexs(_ indexs: [Int], current: Int)
- indexs: Select asset indexs.
- current: Current browser index.
public func photoLibraryDidChange(_ changeInstance: PHChange)
Generated at 2022-03-28T09:06:08+0000 using swift-doc 1.0.0-rc.1.
Types
- ADAddPhotoCell
- ADAddPhotoCell.Key
- ADAlbumListCell
- ADAlbumListCell.Key
- ADAlbumListController
- ADAlbumListDataSource
- ADAlbumModel
- ADAlbumSelectOptions
- ADAlbumType
- ADAsset
- ADAssetBrowserController
- ADAssetBrowserDataSource
- ADAssetBrowserOptions
- ADAssetListDataSource
- ADAssetModel
- ADAssetModel.MediaType
- ADAssetModel.SelectStatus
- ADAssetResult
- ADAssetSelectOptions
- ADBrowserToolBarCell
- ADBrowserToolBarCell.Key
- ADCameraCell
- ADCameraCell.Key
- ADClipInfo
- ADConstraintParams
- ADImageEditController
- ADImageEditInfo
- ADImageEditTools
- ADImageSource
- ADImageStickerContentView
- ADImageStickerDataSource
- ADImageStickerDataSource.StickerItem
- ADImageStickerDataSource.StickerSection
- ADInteractStrategy
- ADInteractType
- ADInteractZIndex
- ADLocale
- ADLocale.LocaleKey
- ADPhotoKitConfig
- ADPhotoKitConfiguration
- ADPhotoKitConfiguration.ThumbnailControllerLayout
- ADPhotoKitUI
- ADPhotoManager
- ADPhotoManager.AssetResultType
- ADPhotoSelectParams
- ADPickerStyle
- ADRotation
- ADSelectAssetModel
- ADStickerContentView
- ADStickerInteractView
- ADTextSticker
- ADTextSticker.Style
- ADThumbnailListCell
- ADThumbnailListCell.Appearance
- ADThumbnailListCell.Key
- ADThumbnailListCell.State
- ADThumbnailViewController
- ADVideoSource
Protocols
- ADAlbumListCellConfigurable
- ADAlbumListNavBarConfigurable
- ADAlertConfigurable
- ADAssetBrowsable
- ADBrowserCellConfigurable
- ADBrowserNavBarConfigurable
- ADBrowserToolBarConfigurable
- ADDataSourceReloadable
- ADImageBrowserCellConfigurable
- ADImageClipConfigurable
- ADImageEditTool
- ADImageEditToolCodable
- ADImageStickerSelectConfigurable
- ADProgressConfigurable
- ADProgressHUDConfigurable
- ADSourceImageEditable
- ADSourceImageModify
- ADTextStickerEditConfigurable
- ADThumbnailCellConfigurable
- ADThumbnailNavBarConfigurable
- ADThumbnailToolBarConfigurable
- ADToolConfigable
- ADToolInteractable
- ADVideoBrowserCellConfigurable
Global Typealiases
- ADAlbumListCellable
- ADAlbumListNavBarable
- ADBrowserCellable
- ADBrowserNavBarable
- ADBrowserToolBarable
- ADClipingInfo
- ADImageBrowserCellable
- ADImageClipable
- ADImageStickerSelectable
- ADProgressHUDable
- ADProgressableable
- ADTextStickerColor
- ADTextStickerEditable
- ADThumbnailCellable
- ADThumbnailNavBarable
- ADThumbnailToolBarable
- ADVideoBrowserCellable