南鑫林 %!s(int64=5) %!d(string=hai) anos
pai
achega
175f26d432

+ 4 - 0
RainbowPlanet/RainbowPlanet.xcodeproj/project.pbxproj

@@ -414,6 +414,7 @@
 		A7CA340223839B28009B0C40 /* NXLAssetsCollection.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7CA340123839B28009B0C40 /* NXLAssetsCollection.swift */; };
 		A7CA34042383C119009B0C40 /* Extension+PHFetchOptions.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7CA34032383C119009B0C40 /* Extension+PHFetchOptions.swift */; };
 		A7CA34062383C1C9009B0C40 /* NXLPhotoPickerConfigure.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7CA34052383C1C9009B0C40 /* NXLPhotoPickerConfigure.swift */; };
+		A7CA34082383ECB1009B0C40 /* PublishNewAlbumTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7CA34072383ECB1009B0C40 /* PublishNewAlbumTableViewCell.swift */; };
 		A7CC19B52382678E0053B4B5 /* PublishNewAlbumView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7CC19B42382678E0053B4B5 /* PublishNewAlbumView.swift */; };
 		A7CC19B8238270940053B4B5 /* PublishNewAlbumNavigationBarView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7CC19B7238270940053B4B5 /* PublishNewAlbumNavigationBarView.swift */; };
 		A7CC19BA238270D30053B4B5 /* PublishNewAlbumPreView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7CC19B9238270D30053B4B5 /* PublishNewAlbumPreView.swift */; };
@@ -1208,6 +1209,7 @@
 		A7CA340123839B28009B0C40 /* NXLAssetsCollection.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NXLAssetsCollection.swift; sourceTree = "<group>"; };
 		A7CA34032383C119009B0C40 /* Extension+PHFetchOptions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Extension+PHFetchOptions.swift"; sourceTree = "<group>"; };
 		A7CA34052383C1C9009B0C40 /* NXLPhotoPickerConfigure.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NXLPhotoPickerConfigure.swift; sourceTree = "<group>"; };
+		A7CA34072383ECB1009B0C40 /* PublishNewAlbumTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PublishNewAlbumTableViewCell.swift; sourceTree = "<group>"; };
 		A7CC19B42382678E0053B4B5 /* PublishNewAlbumView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PublishNewAlbumView.swift; sourceTree = "<group>"; };
 		A7CC19B7238270940053B4B5 /* PublishNewAlbumNavigationBarView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PublishNewAlbumNavigationBarView.swift; sourceTree = "<group>"; };
 		A7CC19B9238270D30053B4B5 /* PublishNewAlbumPreView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PublishNewAlbumPreView.swift; sourceTree = "<group>"; };
@@ -4095,6 +4097,7 @@
 			children = (
 				A7CC19BB238271080053B4B5 /* PublishNewAlbumCollocationView.swift */,
 				A7CA33FA2383888F009B0C40 /* PublishNewAlbumTableView.swift */,
+				A7CA34072383ECB1009B0C40 /* PublishNewAlbumTableViewCell.swift */,
 			);
 			path = PublishNewAlbumCollocationTableView;
 			sourceTree = "<group>";
@@ -6489,6 +6492,7 @@
 				BD61226022C3561C00D3F513 /* AliyunRateSelectView.m in Sources */,
 				A7C0FDF022B6538200BC1E86 /* CommunityBannerFSPagerViewCell.swift in Sources */,
 				A763DFF4237C144400B2ADBF /* MessageHomeOneSectionTableViewCell.swift in Sources */,
+				A7CA34082383ECB1009B0C40 /* PublishNewAlbumTableViewCell.swift in Sources */,
 				A7EE5BD4236C16E100309931 /* SwiftMoyaServiceDownLoadApi.swift in Sources */,
 				BDE376DB22C22A260055E2EA /* UIView+AlivcHelper.m in Sources */,
 				A7DE18D723795A3200D9D72E /* PublishManagerUploadView.swift in Sources */,

+ 3 - 3
RainbowPlanet/RainbowPlanet/Base/BaseTabbarViewController/BaseTabbarViewController.swift

@@ -93,10 +93,10 @@ class BaseTabbarViewController: UITabBarController {
         if !AliyunVodUpToyoPublishManager.shared.isUploading { // 是否正在上传中
             PublishNewPopView.show(imageStrs: ["publish_btn_picture","publish_btn_video","publish_btn_photo","publish_btn_article"], titles: ["相册","视频","拍照","文章"], columnCount: 4) { [weak self] (index) in
                 if index != 3 {
-                    let pickVc = PublishViewController()
-                    pickVc.index = index
-//                    let  pickVc = PublishNewViewController()
+//                    let pickVc = PublishViewController()
 //                    pickVc.index = index
+                    let  pickVc = PublishNewViewController()
+                    pickVc.index = index
                     let nav = BaseNavigationViewController.init(rootViewController: pickVc)
                     nav.modalPresentationStyle = .fullScreen
                     self?.present(nav, animated: true, completion: nil)

+ 14 - 14
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/Community/ViewController/Main/CommunityViewController.swift

@@ -65,10 +65,10 @@ class CommunityViewController: BaseViewController {
         navigationBar.isHidden = true
         view.addSubview(segmentedView)
         view.addSubview(listContainerView)
-        listContainerView.addSubview(publishUploadProgressView)
-        listContainerView.bringSubviewToFront(publishUploadProgressView)
-//        listContainerView.addSubview(publishManagerUploadView)
-//        listContainerView.bringSubviewToFront(publishManagerUploadView)
+//        listContainerView.addSubview(publishUploadProgressView)
+//        listContainerView.bringSubviewToFront(publishUploadProgressView)
+        listContainerView.addSubview(publishManagerUploadView)
+        listContainerView.bringSubviewToFront(publishManagerUploadView)
 
         view.addSubview(communityNavigationBarView)
         
@@ -93,15 +93,15 @@ class CommunityViewController: BaseViewController {
             make.left.right.bottom.equalToSuperview()
         }
         
-        publishUploadProgressView.snp.makeConstraints { (make) in
-            make.top.left.right.equalToSuperview()
-             make.height.equalTo(62)
-        }
-        
-//        publishManagerUploadView.snp.makeConstraints { (make) in
+//        publishUploadProgressView.snp.makeConstraints { (make) in
 //            make.top.left.right.equalToSuperview()
 //             make.height.equalTo(62)
 //        }
+        
+        publishManagerUploadView.snp.makeConstraints { (make) in
+            make.top.left.right.equalToSuperview()
+             make.height.equalTo(62)
+        }
 
 
     }
@@ -214,10 +214,10 @@ class CommunityViewController: BaseViewController {
         // 待发布
         observe = NotificationCenter.default.addObserver(forName: NSNotification.Name("DismissFromPublishEditVc"), object: nil, queue: OperationQueue.main) {[weak self] (notification) in
             self?.reloadSegmentedFollowView()
-            let aliyunVodUpToYoPublishModel = notification.object as? AliyunVodUpToYoPublishModel
-            self?.publishUploadProgressView.aliyunVodUpToYoPublishModel = aliyunVodUpToYoPublishModel
-//            let publishManagerModel = notification.object as? PublishManagerModel
-//            self?.publishManagerUploadView.publishManagerModel = publishManagerModel
+//            let aliyunVodUpToYoPublishModel = notification.object as? AliyunVodUpToYoPublishModel
+//            self?.publishUploadProgressView.aliyunVodUpToYoPublishModel = aliyunVodUpToYoPublishModel
+            let publishManagerModel = notification.object as? PublishManagerModel
+            self?.publishManagerUploadView.publishManagerModel = publishManagerModel
 
         }
         

+ 27 - 34
RainbowPlanet/RainbowPlanet/Modules/PublishNewModule/PublishNew/View/PublishNewAlbumView/NXLPhotoPicker/NXLAssetsCollection.swift

@@ -8,31 +8,6 @@
 
 import UIKit
 
-public enum PHFetchedResultGroupedBy {
-    case year
-    case month
-    case week
-    case day
-    case hour
-    case custom(dateFormat: String)
-    var dateFormat: String {
-        switch self {
-        case .year:
-            return "yyyy"
-        case .month:
-            return "yyyyMM"
-        case .week:
-            return "yyyyMMW"
-        case .day:
-            return "yyyyMMdd"
-        case .hour:
-            return "yyyyMMddHH"
-        case let .custom(dateFormat):
-            return dateFormat
-        }
-    }
-}
-
 struct NXLAssetsCollection {
     
     /// 资源列表
@@ -42,7 +17,7 @@ struct NXLAssetsCollection {
     var fetchResult: PHFetchResult<PHAsset>? = nil
     
     /// 是否是使用相机
-    var isUseCameraButton: Bool = false
+    var isUsedCamera: Bool = false
     
     /// 最近点
     var recentPosition: CGPoint = CGPoint.zero
@@ -50,6 +25,24 @@ struct NXLAssetsCollection {
     /// 标题
     var title: String
     
+    /// 封面
+    var coverImage : UIImage {
+        get {
+            if self.fetchResult?.count ?? 0 > 0 {
+                return NXLPhotoLibrary.fullResolutionImageData(asset: (self.fetchResult?.firstObject)!)!
+            }else {
+                return UIImage(named: "default_pic")!
+            }
+        }
+    }
+    
+    /// 资源的数
+    var fetchResultCount :Int {
+        get {
+            return self.fetchResult?.count ?? 0
+        }
+    }
+    
     /// 本地标识符
     var localIdentifier: String
     
@@ -59,8 +52,8 @@ struct NXLAssetsCollection {
     /// 数量
     var count: Int {
         get {
-            guard let count = self.fetchResult?.count, count > 0 else { return self.isUseCameraButton ? 1 : 0 }
-            return count + (self.isUseCameraButton ? 1 : 0)
+            guard let count = self.fetchResult?.count, count > 0 else { return self.isUsedCamera ? 1 : 0 }
+            return count + (self.isUsedCamera ? 1 : 0)
         }
     }
     
@@ -80,8 +73,8 @@ struct NXLAssetsCollection {
     /// 获取PHAsset
     /// - Parameter index: 指定的资源
     func getAsset(at index: Int) -> PHAsset? {
-        if self.isUseCameraButton && index == 0 { return nil }
-        let index = index - (self.isUseCameraButton ? 1 : 0)
+        if self.isUsedCamera && index == 0 { return nil }
+        let index = index - (self.isUsedCamera ? 1 : 0)
         guard let result = self.fetchResult, index < result.count else { return nil }
         return result.object(at: max(index,0))
     }
@@ -89,15 +82,15 @@ struct NXLAssetsCollection {
     /// 获取NXLPHAsset
     /// - Parameter indexPath: 指定的资源
     func getTLAsset(at indexPath: IndexPath) -> NXLPHAsset? {
-        let isCameraRow = self.isUseCameraButton && indexPath.section == 0 && indexPath.row == 0
+        let isCameraRow = self.isUsedCamera && indexPath.section == 0 && indexPath.row == 0
         if isCameraRow { return nil }
         if let sections = self.sections {
-            let index = indexPath.row - ((self.isUseCameraButton && indexPath.section == 0) ? 1 : 0)
+            let index = indexPath.row - ((self.isUsedCamera && indexPath.section == 0) ? 1 : 0)
             let result = sections[safe: indexPath.section]
             return result?.assets[safe: index]
         }else {
             var index = indexPath.row
-            index = index - (self.isUseCameraButton ? 1 : 0)
+            index = index - (self.isUsedCamera ? 1 : 0)
             guard let result = self.fetchResult, index < result.count else { return nil }
             return NXLPHAsset(asset: result.object(at: max(index,0)))
         }
@@ -107,7 +100,7 @@ struct NXLAssetsCollection {
     /// - Parameter groupedBy: 分区类型
     mutating func reloadSection(groupedBy: PHFetchedResultGroupedBy) {
         var groupedSections = self.section(groupedBy: groupedBy)
-        if self.isUseCameraButton {
+        if self.isUsedCamera {
             groupedSections.insert(("camera",[NXLPHAsset(asset: nil)]), at: 0)
         }
         self.sections = groupedSections

+ 128 - 6
RainbowPlanet/RainbowPlanet/Modules/PublishNewModule/PublishNew/View/PublishNewAlbumView/NXLPhotoPicker/NXLPhotoLibrary.swift

@@ -197,12 +197,6 @@ extension NXLPhotoLibrary {
             let durationPredicate = NSPredicate(format: "duration < %f", maxVideoDuration)
             options.merge(predicate: durationPredicate)
         }
-        
-        /// 最小时长
-        if let minVideoDuration = configure.minVideoDuration {
-            let durationPredicate = NSPredicate(format: "duration >= %f", minVideoDuration)
-            options.merge(predicate: durationPredicate)
-        }
         return options
     }
     
@@ -217,4 +211,132 @@ extension NXLPhotoLibrary {
         return PHAsset.fetchAssets(in: phAssetCollection, options: options)
     }
     
+    /// 提取结果 
+    /// - Parameter configure: NXLPhotoPickerConfigure
+    func fetchCollection(configure: NXLPhotoPickerConfigure) {
+        let isUsedCamera = configure.isUsedCamera
+        let options = getOption(configure: configure)
+        let fetchCollectionOption = configure.fetchCollectionOption
+        
+        
+        /// 获取相册
+        /// - Parameters:
+        ///   - subType: 类型
+        ///   - result: 返回值
+        func getAlbum(subType: PHAssetCollectionSubtype, result: inout [NXLAssetsCollection]) {
+            let collectionOption = fetchCollectionOption[.assetCollections(.album)]
+            let fetchCollection = PHAssetCollection.fetchAssetCollections(with: .album,
+                                                                          subtype: subType,
+                                                                          options: collectionOption)
+            var collections = [PHAssetCollection]()
+            fetchCollection.enumerateObjects { (collection, index, _) in
+                if configure.isAllowedAlbumCloudShared == false && collection.assetCollectionSubtype == .albumCloudShared {
+                }else {
+                    collections.append(collection)
+                }
+            }
+            for collection in collections {
+                if !result.contains(where: { $0.localIdentifier == collection.localIdentifier }) {
+                    var assetsCollection = NXLAssetsCollection(collection: collection)
+                    assetsCollection.title = configure.customLocalizedTitle[assetsCollection.title] ?? assetsCollection.title
+                    assetsCollection.fetchResult = PHAsset.fetchAssets(in: collection, options: options)
+                    if assetsCollection.count > 0 {
+                        result.append(assetsCollection)
+                    }
+                }
+            }
+        }
+        
+        /// 获取小相册
+        /// - Parameters:
+        ///   - subType: 类型
+        ///   - isUseCamera: 是否使用相机
+        ///   - result: [NXLAssetsCollection]
+        @discardableResult
+        
+        func getSmartAlbum(subType: PHAssetCollectionSubtype, isUseCamera: Bool? = false, result: inout [NXLAssetsCollection])
+            -> NXLAssetsCollection?
+        {
+            let collectionOption = fetchCollectionOption[.assetCollections(.smartAlbum)]
+            let fetchCollection = PHAssetCollection.fetchAssetCollections(with: .smartAlbum,
+                                                                          subtype: subType,
+                                                                          options: collectionOption)
+            if
+                let collection = fetchCollection.firstObject,
+                result.contains(where: { $0.localIdentifier == collection.localIdentifier }) == false
+            {
+                var assetsCollection = NXLAssetsCollection(collection: collection)
+                assetsCollection.title = configure.customLocalizedTitle[assetsCollection.title] ?? assetsCollection.title
+                assetsCollection.fetchResult = PHAsset.fetchAssets(in: collection, options: options)
+                if assetsCollection.count > 0 || isUseCamera ?? false {
+                    result.append(assetsCollection)
+                    return assetsCollection
+                }
+            }
+            return nil
+        }
+        
+        if let fetchCollectionTypes = configure.fetchCollectionTypes {
+            DispatchQueue.global(qos: .userInteractive).async { [weak self] in
+                var assetCollections = [NXLAssetsCollection]()
+                for (type,subType) in fetchCollectionTypes {
+                    if type == .smartAlbum {
+                        getSmartAlbum(subType: subType, result: &assetCollections)
+                    }else {
+                        getAlbum(subType: subType, result: &assetCollections)
+                    }
+                }
+                DispatchQueue.main.async {
+                    self?.delegate?.loadCompleteAllCollection(collections: assetCollections)
+                }
+            }
+        }else {
+            DispatchQueue.global(qos: .userInteractive).async { [weak self] in
+                var assetCollections = [NXLAssetsCollection]()
+                //Camera Roll
+                let camerarollCollection = getSmartAlbum(subType: .smartAlbumUserLibrary,
+                                                         isUseCamera: isUsedCamera,
+                                                         result: &assetCollections)
+                if var cameraRoll = camerarollCollection {
+                    cameraRoll.title = configure.customLocalizedTitle[cameraRoll.title] ?? cameraRoll.title
+                    cameraRoll.isUsedCamera = isUsedCamera
+                    assetCollections[0] = cameraRoll
+                    DispatchQueue.main.async {
+                        self?.delegate?.loadCameraRollCollection(collection: cameraRoll)
+                    }
+                }
+                //Selfies
+                getSmartAlbum(subType: .smartAlbumSelfPortraits, result: &assetCollections)
+                //Panoramas
+                getSmartAlbum(subType: .smartAlbumPanoramas, result: &assetCollections)
+                //Favorites
+                getSmartAlbum(subType: .smartAlbumFavorites, result: &assetCollections)
+                //CloudShared
+                getSmartAlbum(subType: .albumCloudShared, result: &assetCollections)
+                //get all another albums
+                getAlbum(subType: .any, result: &assetCollections)
+                if configure.isAllowedVideo ?? false {
+                    //Videos
+                    getSmartAlbum(subType: .smartAlbumVideos, result: &assetCollections)
+                }
+                //Album
+                let collectionOption = fetchCollectionOption[.topLevelUserCollections]
+                let albumsResult = PHCollectionList.fetchTopLevelUserCollections(with: collectionOption)
+                albumsResult.enumerateObjects({ (collection, index, stop) -> Void in
+                    guard let collection = collection as? PHAssetCollection else { return }
+                    var assetsCollection = NXLAssetsCollection(collection: collection)
+                    assetsCollection.title = configure.customLocalizedTitle[assetsCollection.title] ?? assetsCollection.title
+                    assetsCollection.fetchResult = PHAsset.fetchAssets(in: collection, options: options)
+                    if assetsCollection.count > 0, !assetCollections.contains(where: { $0.localIdentifier == collection.localIdentifier }) {
+                        assetCollections.append(assetsCollection)
+                    }
+                })
+                
+                DispatchQueue.main.async {
+                    self?.delegate?.loadCompleteAllCollection(collections: assetCollections)
+                }
+            }
+        }
+    }
+    
 }

+ 68 - 7
RainbowPlanet/RainbowPlanet/Modules/PublishNewModule/PublishNew/View/PublishNewAlbumView/NXLPhotoPicker/NXLPhotoPickerConfigure.swift

@@ -9,17 +9,23 @@
 import Foundation
 
 struct NXLPhotoPickerConfigure {
-    /// 是否总是视频
-    var isAllowedVideo : Bool? = nil
+    /// 是否允许视频
+    var isAllowedVideo : Bool? = true
     
-    /// 是否总是照片
-    var isAllowedPhotos : Bool? = nil
+    /// 是否允许照片
+    var isAllowedPhotos : Bool? = true
     
-    /// 是否总是实时照片
-    var isAllowedLivePhotos : Bool? = nil
+    /// 是否允许实时照片
+    var isAllowedLivePhotos : Bool? = true
     
     /// 是否是使用相机
-    var isUsedCamera: Bool? = true
+    var isUsedCamera: Bool = false
+    
+    /// 是否允许云端相册
+    var isAllowedAlbumCloudShared : Bool? = false
+    
+    /// 是否允许视屏录制
+    var isAllowedVideoRecording : Bool? = false
     
     /// 提取设置
     var fetchOption: PHFetchOptions? = nil
@@ -33,4 +39,59 @@ struct NXLPhotoPickerConfigure {
     /// 最小时长
     var minVideoDuration:TimeInterval? = nil
     
+    /// 提取的类型
+    public var fetchCollectionTypes: [(PHAssetCollectionType,PHAssetCollectionSubtype)]? = nil
+    
+    /// 提取fetchCollectionOption
+    var fetchCollectionOption: [FetchCollectionType: PHFetchOptions] = [:]
+    
+    /// 自定义本地的标题
+    var customLocalizedTitle: [String: String] = ["Camera Roll": "Camera Roll"]
+
+    
+}
+
+public enum PHFetchedResultGroupedBy {
+    case year
+    case month
+    case week
+    case day
+    case hour
+    case custom(dateFormat: String)
+    var dateFormat: String {
+        switch self {
+        case .year:
+            return "yyyy"
+        case .month:
+            return "yyyyMM"
+        case .week:
+            return "yyyyMMW"
+        case .day:
+            return "yyyyMMdd"
+        case .hour:
+            return "yyyyMMddHH"
+        case let .custom(dateFormat):
+            return dateFormat
+        }
+    }
+}
+
+public enum FetchCollectionType {
+    case assetCollections(PHAssetCollectionType)
+    case topLevelUserCollections
+}
+
+extension FetchCollectionType: Hashable {
+    private var identifier: String {
+        switch self {
+        case let .assetCollections(collectionType):
+            return "assetCollections\(collectionType.rawValue)"
+        case .topLevelUserCollections:
+            return "topLevelUserCollections"
+        }
+    }
+    
+    public func hash(into hasher: inout Hasher) {
+        hasher.combine(self.identifier)
+    }
 }

+ 71 - 20
RainbowPlanet/RainbowPlanet/Modules/PublishNewModule/PublishNew/View/PublishNewAlbumView/PublishNewAlbumCollocationTableView/PublishNewAlbumTableView.swift

@@ -7,48 +7,99 @@
 //
 
 import UIKit
+import RxSwift
 
-class PublishNewAlbumTableView: BaseView {
-
-    /*
-    // Only override draw() if you perform custom drawing.
-    // An empty implementation adversely affects performance during animation.
-    override func draw(_ rect: CGRect) {
-        // Drawing code
-    }
-    */
+class PublishNewAlbumTableView: UIView {
     
-    /// 资源
-    lazy var photoLibrary: TLPhotoLibrary = {
-        let photoLibrary = TLPhotoLibrary()
+    let disposeBag = DisposeBag()
+    /// 配置
+    var configure : NXLPhotoPickerConfigure?
+    
+    /// 媒体资源
+    lazy var photoLibrary: NXLPhotoLibrary = {
+        let photoLibrary = NXLPhotoLibrary()
         photoLibrary.delegate = self
         return photoLibrary
     }()
     
     /// 资源
-    lazy var collections: Array<TLAssetsCollection> = {
-        let collections = Array<TLAssetsCollection>()
+    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() {
+
+    }
     
-    override func setupViews() {
-        
+    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 : TLPhotoLibraryDelegate {
+extension PublishNewAlbumTableView : NXLPhotoLibraryDelegate {
     
     /// 加载相机collection
-    func loadCameraRollCollection(collection: TLAssetsCollection) {
+    func loadCameraRollCollection(collection: NXLAssetsCollection) {
         self.collections = [collection]
     }
     
     /// 加载所有collections
-    func loadCompleteAllCollection(collections: [TLAssetsCollection]) {
+    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 {
+//
+//}

+ 76 - 0
RainbowPlanet/RainbowPlanet/Modules/PublishNewModule/PublishNew/View/PublishNewAlbumView/PublishNewAlbumCollocationTableView/PublishNewAlbumTableViewCell.swift

@@ -0,0 +1,76 @@
+//
+//  PublishNewAlbumTableViewCell.swift
+//  RainbowPlanet
+//
+//  Created by 南鑫林 on 2019/11/19.
+//  Copyright © 2019 RainbowPlanet. All rights reserved.
+//
+
+import UIKit
+
+class PublishNewAlbumTableViewCell: UITableViewCell {
+
+    class func cellWith(tableView:UITableView,indexPath:IndexPath) -> PublishNewAlbumTableViewCell {
+        let ID = "PublishNewAlbumTableViewCell"
+        tableView.register(PublishNewAlbumTableViewCell.self, forCellReuseIdentifier: ID)
+        let cell : PublishNewAlbumTableViewCell = tableView.dequeueReusableCell(withIdentifier: ID, for: indexPath) as! PublishNewAlbumTableViewCell
+        cell.indexPath = indexPath
+        return cell
+    }
+    
+    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
+        super.init(style: style, reuseIdentifier: reuseIdentifier)
+        setupViews()
+        setupLayouts()
+    }
+    
+    required init?(coder aDecoder: NSCoder) {
+        fatalError("init(coder:) has not been implemented")
+    }
+    
+    var indexPath: IndexPath? {
+        didSet {
+            
+        }
+    }
+    //MRAK: - 设置View
+    private func setupViews() {
+        self.selectionStyle = .none
+        addSubview(coverImage)
+        
+        
+    }
+    
+    private func setupLayouts() {
+        coverImage.snp.makeConstraints { (make) in
+            make.centerY.equalToSuperview()
+            make.left.equalTo(14)
+            make.size.equalTo(60)
+        }
+    }
+    
+    /// 封面图
+    lazy var coverImage: UIImageView = {
+        let coverImage = UIImageView()
+        coverImage.cornerRadius = 4
+        coverImage.masksToBounds = true
+        return coverImage
+    }()
+    
+    /// 标题
+    lazy var titleLabel: UILabel = {
+        let titleLabel = UILabel()
+        titleLabel.font = kMediumFont15
+        titleLabel.textColor = k333333Color
+        return titleLabel
+    }()
+    
+    /// 副标题
+    lazy var detailTitleLabel: UILabel = {
+        let detailTitleLabel = UILabel()
+        detailTitleLabel.font = kMediumFont15
+        detailTitleLabel.textColor = k333333Color
+        return detailTitleLabel
+    }()
+    
+}

+ 25 - 0
RainbowPlanet/RainbowPlanet/Modules/PublishNewModule/PublishNew/View/PublishNewAlbumView/PublishNewAlbumView.swift

@@ -15,6 +15,7 @@ class PublishNewAlbumView: BaseView {
         addSubview(publishNewAlbumNavigationBarView)
         addSubview(publishNewAlbumPreView)
         addSubview(publishNewAlbumCollocationView)
+        addSubview(publishNewAlbumTableView)
         addGestureRecognizer(panGesture)
     }
     
@@ -35,6 +36,7 @@ class PublishNewAlbumView: BaseView {
     }
     
     override func setupData() {
+        
         publishNewAlbumNavigationBarView.backButton.rx.tap.subscribe(onNext: { (_) in
             let vc = UIViewController.topMost
             vc?.navigationController?.dismiss(animated: true, completion: nil)
@@ -59,6 +61,29 @@ class PublishNewAlbumView: BaseView {
         return publishNewAlbumCollocationView
     }()
     
+    /// PublishNewAlbumTableView
+    lazy var publishNewAlbumTableView: PublishNewAlbumTableView = {
+        let publishNewAlbumTableView = PublishNewAlbumTableView(configure: configure)
+        publishNewAlbumTableView.frame = CGRect(x: 0, y: kNavBarTotalHeight, width: kScreenWidth, height: kScreenHeight - kNavBarTotalHeight)
+        publishNewAlbumTableView.alpha = 0
+        return publishNewAlbumTableView
+    }()
+    
+    lazy var configure : NXLPhotoPickerConfigure = {
+        var configure = NXLPhotoPickerConfigure()
+        configure.isAllowedVideo = true
+        configure.isAllowedPhotos = true
+        configure.isAllowedLivePhotos = true
+        configure.isUsedCamera = false
+        configure.isAllowedAlbumCloudShared = false
+        configure.isAllowedVideoRecording = false
+        configure.mediaType = nil
+        configure.maxVideoDuration = nil
+        configure.minVideoDuration = 3.0
+        configure.fetchCollectionTypes = nil
+        return configure
+    }()
+    
     /// 移动
     lazy var panGesture: UIPanGestureRecognizer = {
         let panGesture = UIPanGestureRecognizer()

+ 0 - 19
RainbowPlanet/RainbowPlanet/Tools/TLPhotoPicker/TLPhotosPickerViewController.swift

@@ -91,25 +91,6 @@ public struct TLPhotosPickerConfigure {
     }
 }
 
-public enum FetchCollectionType {
-    case assetCollections(PHAssetCollectionType)
-    case topLevelUserCollections
-}
-
-extension FetchCollectionType: Hashable {
-    private var identifier: String {
-        switch self {
-        case let .assetCollections(collectionType):
-            return "assetCollections\(collectionType.rawValue)"
-        case .topLevelUserCollections:
-            return "topLevelUserCollections"
-        }
-    }
-    
-    public func hash(into hasher: inout Hasher) {
-        hasher.combine(self.identifier)
-    }
-}
 
 public enum PopupConfigure {
     case animation(TimeInterval)