123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109 |
- //
- // PublishNewAlbumTableView.swift
- // RainbowPlanet
- //
- // Created by 南鑫林 on 2019/11/19.
- // Copyright © 2019 RainbowPlanet. All rights reserved.
- //
- import UIKit
- import RxSwift
- class PublishNewAlbumTableView: UIView {
-
- let disposeBag = DisposeBag()
- /// 配置
- var configure : NXLPhotoPickerConfigure?
-
- /// 媒体资源
- lazy var photoLibrary: NXLPhotoLibrary = {
- let photoLibrary = NXLPhotoLibrary()
- photoLibrary.delegate = self
- return photoLibrary
- }()
-
- /// 资源
- lazy var collections: Array<NXLAssetsCollection> = {
- let collections = Array<NXLAssetsCollection>()
- return collections
- }()
-
- override init(frame: CGRect) {
- super.init(frame: frame)
- }
- required init?(coder aDecoder: NSCoder) {
- fatalError("init(coder:) has not been implemented")
- }
-
- init(configure:NXLPhotoPickerConfigure? = nil) {
- self.init()
- self.configure = configure
- self.setupViews()
- self.setupLayouts()
- self.setupData()
- }
- func setupViews() {
- backgroundColor = UIColor.white
- }
- func setupLayouts() {
- }
-
- func setupData() {
- if NXLPermission.isAllowed(NXLPermissionType.photoLibrary) {
- guard let configure = self.configure else { return }
- photoLibrary.fetchCollection(configure: configure)
- }
- }
-
- lazy var tableView: UITableView = {
- let tableView = UITableView(frame: CGRect.zero, style: UITableView.Style.grouped)
- tableView.separatorStyle = .none
- tableView.backgroundColor = UIColor.clear
- // tableView.dataSource = self
- // tableView.delegate = self
- tableView.rowHeight = 80
- return tableView
- }()
-
-
-
-
- }
- extension PublishNewAlbumTableView : NXLPhotoLibraryDelegate {
-
- /// 加载相机collection
- func loadCameraRollCollection(collection: NXLAssetsCollection) {
- self.collections = [collection]
- }
-
- /// 加载所有collections
- func loadCompleteAllCollection(collections: [NXLAssetsCollection]) {
- self.collections = collections
- }
-
- }
- //extension PublishNewAlbumTableView : UITableViewDataSource {
- // func numberOfSections(in tableView: UITableView) -> Int {
- // return 1
- // }
- //
- // func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
- // return self.collections.count
- // }
- //
- // func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
- //
- // }
- //}
- //
- //extension PublishNewAlbumTableView : UITableViewDelegate {
- //
- //}
|