南鑫林 5 yıl önce
ebeveyn
işleme
088ee56014
34 değiştirilmiş dosya ile 30 ekleme ve 3719 silme
  1. 1 81
      RainbowPlanet/RainbowPlanet.xcodeproj/project.pbxproj
  2. 0 318
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/PhotoPicker/TLPhotoPicker/CustomCameraCell.swift
  3. 0 174
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/PhotoPicker/TLPhotoPicker/PhotoCaptureDelegate.swift
  4. 0 77
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/PhotoPicker/TLPhotoPicker/PreviewView.swift
  5. 0 54
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/PhotoPicker/TLPhotoPicker/SynchronizedDictionary.swift
  6. 0 78
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/PhotoPicker/TLPhotoPicker/TLAlbumPopView.swift
  7. 0 68
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/PhotoPicker/TLPhotoPicker/TLAssetCollection+Extension.swift
  8. 0 370
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/PhotoPicker/TLPhotoPicker/TLAssetsCollection.swift
  9. 0 29
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/PhotoPicker/TLPhotoPicker/TLBundle.swift
  10. 0 22
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/PhotoPicker/TLPhotoPicker/TLCollectionTableViewCell.swift
  11. 0 391
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/PhotoPicker/TLPhotoPicker/TLPhontoPreviewView.swift
  12. 0 203
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/PhotoPicker/TLPhotoPicker/TLPhotoCollectionViewCell.swift
  13. 0 274
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/PhotoPicker/TLPhotoPicker/TLPhotoLibrary.swift
  14. 0 55
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/PhotoPicker/TLPhotoPicker/TLPhotopickerProtocol.swift
  15. 0 1018
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/PhotoPicker/TLPhotoPicker/TLPhotosPickerViewController.swift
  16. 0 53
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/PhotoPicker/TLPhotoPickerResources/CustomCameraCell.xib
  17. 0 58
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/PhotoPicker/TLPhotoPickerResources/TLCollectionTableViewCell.xib
  18. 0 150
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/PhotoPicker/TLPhotoPickerResources/TLPhotoCollectionViewCell.xib
  19. BIN
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/PhotoPicker/TLPhotoPickerResources/TLPhotoPickerController.bundle/arrow.png
  20. BIN
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/PhotoPicker/TLPhotoPickerResources/TLPhotoPickerController.bundle/camera@3x.png
  21. BIN
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/PhotoPicker/TLPhotoPickerResources/TLPhotoPickerController.bundle/insertPhotoMaterial@3x.png
  22. BIN
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/PhotoPicker/TLPhotoPickerResources/TLPhotoPickerController.bundle/pop_arrow.png
  23. BIN
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/PhotoPicker/TLPhotoPickerResources/TLPhotoPickerController.bundle/video.png
  24. 0 68
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/PhotoPicker/TLPhotoPickerResources/TLPhotosPickerViewController.xib
  25. 6 2
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishMediaPicker/Controller/KSMediaPickerController.swift
  26. 4 4
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishMediaPicker/KSExtension.swift
  27. 0 0
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishMediaPicker/KSVideoPlayerView/KSVideoLayer.h
  28. 0 0
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishMediaPicker/KSVideoPlayerView/KSVideoLayer.m
  29. 0 0
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishMediaPicker/KSVideoPlayerView/KSVideoPlayerBaseView.h
  30. 0 0
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishMediaPicker/KSVideoPlayerView/KSVideoPlayerBaseView.m
  31. 4 3
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishMediaPicker/Model/KSMediaPickerItemModel.swift
  32. 0 2
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishMediaPicker/View/KSMediaPickerPreviewView.swift
  33. 0 6
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishMediaPicker/View/KSMediaPickerViewImageCell.swift
  34. 15 161
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishViewController.swift

+ 1 - 81
RainbowPlanet/RainbowPlanet.xcodeproj/project.pbxproj

@@ -326,25 +326,7 @@
 		A7AA9F6322C62B270086498B /* CommunityRecommnendViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7AA9F6222C62B270086498B /* CommunityRecommnendViewController.swift */; };
 		A7AA9F6522C63DCD0086498B /* CommunityFollowFeedModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7AA9F6422C63DCD0086498B /* CommunityFollowFeedModel.swift */; };
 		A7AA9F6722C640F10086498B /* CommunityRecommendFeedModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7AA9F6622C640F10086498B /* CommunityRecommendFeedModel.swift */; };
-		A7AD2756230F8D7D0099B3E0 /* TLCollectionTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = A7AD2747230F8D7C0099B3E0 /* TLCollectionTableViewCell.xib */; };
-		A7AD2757230F8D7D0099B3E0 /* TLPhotoPickerController.bundle in Resources */ = {isa = PBXBuildFile; fileRef = A7AD2748230F8D7C0099B3E0 /* TLPhotoPickerController.bundle */; };
-		A7AD2758230F8D7D0099B3E0 /* TLPhotoCollectionViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = A7AD2749230F8D7C0099B3E0 /* TLPhotoCollectionViewCell.xib */; };
-		A7AD2759230F8D7D0099B3E0 /* TLPhotosPickerViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = A7AD274A230F8D7C0099B3E0 /* TLPhotosPickerViewController.xib */; };
 		A7AD277F2310D1E40099B3E0 /* TLPhotoLibrary.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7AD27752310D1E20099B3E0 /* TLPhotoLibrary.swift */; };
-		A7AD27802310D1E40099B3E0 /* TLPhotosPickerViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7AD27762310D1E20099B3E0 /* TLPhotosPickerViewController.swift */; };
-		A7AD27812310D1E40099B3E0 /* TLPhotopickerProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7AD27772310D1E30099B3E0 /* TLPhotopickerProtocol.swift */; };
-		A7AD27822310D1E40099B3E0 /* TLCollectionTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7AD27782310D1E30099B3E0 /* TLCollectionTableViewCell.swift */; };
-		A7AD27832310D1E40099B3E0 /* SynchronizedDictionary.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7AD27792310D1E30099B3E0 /* SynchronizedDictionary.swift */; };
-		A7AD27842310D1E40099B3E0 /* TLPhotoCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7AD277A2310D1E30099B3E0 /* TLPhotoCollectionViewCell.swift */; };
-		A7AD27852310D1E40099B3E0 /* TLBundle.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7AD277B2310D1E30099B3E0 /* TLBundle.swift */; };
-		A7AD27862310D1E40099B3E0 /* TLAssetsCollection.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7AD277C2310D1E40099B3E0 /* TLAssetsCollection.swift */; };
-		A7AD27872310D1E40099B3E0 /* TLAlbumPopView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7AD277D2310D1E40099B3E0 /* TLAlbumPopView.swift */; };
-		A7AD27882310D1E40099B3E0 /* TLAssetCollection+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7AD277E2310D1E40099B3E0 /* TLAssetCollection+Extension.swift */; };
-		A7AD278A2310D44B0099B3E0 /* CustomCameraCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7AD27892310D44B0099B3E0 /* CustomCameraCell.swift */; };
-		A7AD278C2310D4560099B3E0 /* CustomCameraCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = A7AD278B2310D4560099B3E0 /* CustomCameraCell.xib */; };
-		A7AD278F2310D51F0099B3E0 /* PhotoCaptureDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7AD278D2310D51F0099B3E0 /* PhotoCaptureDelegate.swift */; };
-		A7AD27902310D51F0099B3E0 /* PreviewView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7AD278E2310D51F0099B3E0 /* PreviewView.swift */; };
-		A7AD27922312B7050099B3E0 /* TLPhontoPreviewView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7AD27912312B7050099B3E0 /* TLPhontoPreviewView.swift */; };
 		A7B4E71F228131720012914A /* ProductSlidingLeftRightCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7B4E71E228131720012914A /* ProductSlidingLeftRightCollectionViewCell.swift */; };
 		A7B4E721228151F40012914A /* ProductFloorTitleView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7B4E720228151F40012914A /* ProductFloorTitleView.swift */; };
 		A7B4E723228154750012914A /* ProductFloorBannerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7B4E722228154750012914A /* ProductFloorBannerView.swift */; };
@@ -1077,25 +1059,7 @@
 		A7AA9F6222C62B270086498B /* CommunityRecommnendViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CommunityRecommnendViewController.swift; sourceTree = "<group>"; };
 		A7AA9F6422C63DCD0086498B /* CommunityFollowFeedModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CommunityFollowFeedModel.swift; sourceTree = "<group>"; };
 		A7AA9F6622C640F10086498B /* CommunityRecommendFeedModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CommunityRecommendFeedModel.swift; sourceTree = "<group>"; };
-		A7AD2747230F8D7C0099B3E0 /* TLCollectionTableViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = TLCollectionTableViewCell.xib; sourceTree = "<group>"; };
-		A7AD2748230F8D7C0099B3E0 /* TLPhotoPickerController.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = TLPhotoPickerController.bundle; sourceTree = "<group>"; };
-		A7AD2749230F8D7C0099B3E0 /* TLPhotoCollectionViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = TLPhotoCollectionViewCell.xib; sourceTree = "<group>"; };
-		A7AD274A230F8D7C0099B3E0 /* TLPhotosPickerViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = TLPhotosPickerViewController.xib; sourceTree = "<group>"; };
 		A7AD27752310D1E20099B3E0 /* TLPhotoLibrary.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TLPhotoLibrary.swift; sourceTree = "<group>"; };
-		A7AD27762310D1E20099B3E0 /* TLPhotosPickerViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TLPhotosPickerViewController.swift; sourceTree = "<group>"; };
-		A7AD27772310D1E30099B3E0 /* TLPhotopickerProtocol.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TLPhotopickerProtocol.swift; sourceTree = "<group>"; };
-		A7AD27782310D1E30099B3E0 /* TLCollectionTableViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TLCollectionTableViewCell.swift; sourceTree = "<group>"; };
-		A7AD27792310D1E30099B3E0 /* SynchronizedDictionary.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SynchronizedDictionary.swift; sourceTree = "<group>"; };
-		A7AD277A2310D1E30099B3E0 /* TLPhotoCollectionViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TLPhotoCollectionViewCell.swift; sourceTree = "<group>"; };
-		A7AD277B2310D1E30099B3E0 /* TLBundle.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TLBundle.swift; sourceTree = "<group>"; };
-		A7AD277C2310D1E40099B3E0 /* TLAssetsCollection.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TLAssetsCollection.swift; sourceTree = "<group>"; };
-		A7AD277D2310D1E40099B3E0 /* TLAlbumPopView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TLAlbumPopView.swift; sourceTree = "<group>"; };
-		A7AD277E2310D1E40099B3E0 /* TLAssetCollection+Extension.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "TLAssetCollection+Extension.swift"; sourceTree = "<group>"; };
-		A7AD27892310D44B0099B3E0 /* CustomCameraCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CustomCameraCell.swift; sourceTree = "<group>"; };
-		A7AD278B2310D4560099B3E0 /* CustomCameraCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = CustomCameraCell.xib; sourceTree = "<group>"; };
-		A7AD278D2310D51F0099B3E0 /* PhotoCaptureDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PhotoCaptureDelegate.swift; sourceTree = "<group>"; };
-		A7AD278E2310D51F0099B3E0 /* PreviewView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PreviewView.swift; sourceTree = "<group>"; };
-		A7AD27912312B7050099B3E0 /* TLPhontoPreviewView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TLPhontoPreviewView.swift; sourceTree = "<group>"; };
 		A7B4E71E228131720012914A /* ProductSlidingLeftRightCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProductSlidingLeftRightCollectionViewCell.swift; sourceTree = "<group>"; };
 		A7B4E720228151F40012914A /* ProductFloorTitleView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProductFloorTitleView.swift; sourceTree = "<group>"; };
 		A7B4E722228154750012914A /* ProductFloorBannerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProductFloorBannerView.swift; sourceTree = "<group>"; };
@@ -3785,42 +3749,15 @@
 		A7AD2745230F8D7C0099B3E0 /* PhotoPicker */ = {
 			isa = PBXGroup;
 			children = (
-				A7AD2746230F8D7C0099B3E0 /* TLPhotoPickerResources */,
 				A7AD274B230F8D7C0099B3E0 /* TLPhotoPicker */,
 			);
 			path = PhotoPicker;
 			sourceTree = "<group>";
 		};
-		A7AD2746230F8D7C0099B3E0 /* TLPhotoPickerResources */ = {
-			isa = PBXGroup;
-			children = (
-				A7AD2747230F8D7C0099B3E0 /* TLCollectionTableViewCell.xib */,
-				A7AD2748230F8D7C0099B3E0 /* TLPhotoPickerController.bundle */,
-				A7AD2749230F8D7C0099B3E0 /* TLPhotoCollectionViewCell.xib */,
-				A7AD278B2310D4560099B3E0 /* CustomCameraCell.xib */,
-				A7AD274A230F8D7C0099B3E0 /* TLPhotosPickerViewController.xib */,
-			);
-			path = TLPhotoPickerResources;
-			sourceTree = "<group>";
-		};
 		A7AD274B230F8D7C0099B3E0 /* TLPhotoPicker */ = {
 			isa = PBXGroup;
 			children = (
-				A7AD27762310D1E20099B3E0 /* TLPhotosPickerViewController.swift */,
-				A7AD277A2310D1E30099B3E0 /* TLPhotoCollectionViewCell.swift */,
-				A7AD27912312B7050099B3E0 /* TLPhontoPreviewView.swift */,
-				A7AD27792310D1E30099B3E0 /* SynchronizedDictionary.swift */,
-				A7AD277D2310D1E40099B3E0 /* TLAlbumPopView.swift */,
-				A7AD277E2310D1E40099B3E0 /* TLAssetCollection+Extension.swift */,
-				A7AD277C2310D1E40099B3E0 /* TLAssetsCollection.swift */,
-				A7AD277B2310D1E30099B3E0 /* TLBundle.swift */,
-				A7AD27782310D1E30099B3E0 /* TLCollectionTableViewCell.swift */,
 				A7AD27752310D1E20099B3E0 /* TLPhotoLibrary.swift */,
-				A7AD27772310D1E30099B3E0 /* TLPhotopickerProtocol.swift */,
-				A7AD278D2310D51F0099B3E0 /* PhotoCaptureDelegate.swift */,
-				A7AD278E2310D51F0099B3E0 /* PreviewView.swift */,
-				A7AD27892310D44B0099B3E0 /* CustomCameraCell.swift */,
-				BD12B6A422B502C200AEB10B /* KSVideoPlayerView */,
 			);
 			path = TLPhotoPicker;
 			sourceTree = "<group>";
@@ -5093,6 +5030,7 @@
 			isa = PBXGroup;
 			children = (
 				BD12B68722B4F28F00AEB10B /* KSExtension.swift */,
+				BD12B6A422B502C200AEB10B /* KSVideoPlayerView */,
 				BD12B67522B4ECE200AEB10B /* Controller */,
 				BD12B67622B4ED8800AEB10B /* Model */,
 				BD12B67922B4EE1A00AEB10B /* View */,
@@ -6046,14 +5984,11 @@
 				A75B787A22E07A51007B986A /* messageModuleTabbar.json in Resources */,
 				A78A5F7622FAA03800DD1764 /* share_iSpt.gif in Resources */,
 				BDD5483422C31752005BBE19 /* AlivcShortVideoImage.bundle in Resources */,
-				A7AD2759230F8D7D0099B3E0 /* TLPhotosPickerViewController.xib in Resources */,
 				A7CC74DE22703B4A003C4F38 /* MineModule.xcassets in Resources */,
-				A7AD2758230F8D7D0099B3E0 /* TLPhotoCollectionViewCell.xib in Resources */,
 				A7BF202422B392D600396DB3 /* CommunityModule.xcassets in Resources */,
 				A7EF3E102303DAEE001E4D26 /* Launch Screen.storyboard in Resources */,
 				BDD54A2522C31D5F005BBE19 /* music.json in Resources */,
 				A76068E922E4922F008DF18F /* Skittles.json in Resources */,
-				A7AD278C2310D4560099B3E0 /* CustomCameraCell.xib in Resources */,
 				A71AF0BE226F1792001730FE /* ShoppingMallModule.xcassets in Resources */,
 				A7778C9722438F5D00C7C47A /* AlipaySDK.bundle in Resources */,
 				BDD54A2722C31D60005BBE19 /* tail.png in Resources */,
@@ -6064,7 +5999,6 @@
 				A77F2C682231FB4A001BD3F6 /* Assets.xcassets in Resources */,
 				BDD54A2822C31D60005BBE19 /* LocalFilter.json in Resources */,
 				A75B787B22E07A51007B986A /* communityModuleTabbar.json in Resources */,
-				A7AD2756230F8D7D0099B3E0 /* TLCollectionTableViewCell.xib in Resources */,
 				A72C01232275404A0065E0C3 /* province_city_area.json in Resources */,
 				BDD54A2622C31D60005BBE19 /* watermark.png in Resources */,
 				BD108C9B22A60C3300837DAB /* HGImage.storyboard in Resources */,
@@ -6075,7 +6009,6 @@
 				A76068EB22E49BC1008DF18F /* collect.json in Resources */,
 				A7778C9922438F5D00C7C47A /* README.txt in Resources */,
 				BDD54A2922C31D60005BBE19 /* LocalMV.json in Resources */,
-				A7AD2757230F8D7D0099B3E0 /* TLPhotoPickerController.bundle in Resources */,
 				A7BF202722B3930100396DB3 /* MessageModule.xcassets in Resources */,
 				BDD54A2B22C31D78005BBE19 /* filter in Resources */,
 				BD108C9A22A60C3300837DAB /* HGImage.xcassets in Resources */,
@@ -6211,7 +6144,6 @@
 				BD13B6DB22BA03BC008BB323 /* PublishAddressPOIView.swift in Sources */,
 				A72A72BE22321DE000B21995 /* Extension+RxTimer.swift in Sources */,
 				BD61225F22C3561C00D3F513 /* AliyunMagicCameraView.m in Sources */,
-				A7AD27832310D1E40099B3E0 /* SynchronizedDictionary.swift in Sources */,
 				A770E61422D6625700CBD0A4 /* ShareCommunityView.swift in Sources */,
 				A7F2D6CB22B0E4270093000B /* CommunityRecommendFollowCollectionViewCell.swift in Sources */,
 				BDF47D7E22827C3F00941AB9 /* ProductSlidingTopBottomCollectionViewCell.swift in Sources */,
@@ -6281,7 +6213,6 @@
 				A7FF159C228D9E3D00A85748 /* OrderRefundDetailModel.swift in Sources */,
 				A76B786922CE04940047EC1B /* CommunityRecommendDetailHTMLTableViewCell.swift in Sources */,
 				A7C3DD1C226422D200FA262E /* SwiftMoyaNetWorkServiceSMS.swift in Sources */,
-				A7AD27802310D1E40099B3E0 /* TLPhotosPickerViewController.swift in Sources */,
 				BDF862A2228E41CC000DEF84 /* OrderLogisticsInfoCell.swift in Sources */,
 				A72623D322C1FFD100AEF875 /* CommunityPostMyModel.swift in Sources */,
 				A770E5F522D5BC2000CBD0A4 /* ShareCommonStr.swift in Sources */,
@@ -6351,7 +6282,6 @@
 				A71CAB3722C9A40A00D908A8 /* TotalBeanModel.swift in Sources */,
 				A743229B22B8C1510017C367 /* AppStoreManager.swift in Sources */,
 				A7EE6E1223055A5A00628D39 /* MemoryManager.swift in Sources */,
-				A7AD27842310D1E40099B3E0 /* TLPhotoCollectionViewCell.swift in Sources */,
 				BD61225422C355C800D3F513 /* AliyunMagicCameraViewController.m in Sources */,
 				BDAF83A222B330540004BCC3 /* RecommendSimilarCell.swift in Sources */,
 				BDAA40FD228E9CD600CF841D /* OrderApplyRefundPhoneCell.swift in Sources */,
@@ -6384,7 +6314,6 @@
 				A7DC467F22783A47001F3EFC /* EditExpressAddressTableViewCell.swift in Sources */,
 				A7A98E4522804C63005306E9 /* ShoppingMallSepcialCollectionViewCell.swift in Sources */,
 				A7AA9F6722C640F10086498B /* CommunityRecommendFeedModel.swift in Sources */,
-				A7AD27902310D51F0099B3E0 /* PreviewView.swift in Sources */,
 				A7824B082271F53A00ABA381 /* EditSetDefaultTableViewCell.swift in Sources */,
 				A77F2CC3223203BA001BD3F6 /* AppDelegate+Window.swift in Sources */,
 				A7824B062271F25400ABA381 /* EditAddressTableViewCell.swift in Sources */,
@@ -6413,7 +6342,6 @@
 				A790706122B9C294008CE279 /* ModifyDataNickNameSignView.swift in Sources */,
 				BD12204622AF997E0051C7C2 /* MessageListTableCell.swift in Sources */,
 				BDF862AA228E43A4000DEF84 /* OrderCommentTableViewCell.swift in Sources */,
-				A7AD27862310D1E40099B3E0 /* TLAssetsCollection.swift in Sources */,
 				A7B4E754228278320012914A /* ShoppingMallFloorTableViewCell.swift in Sources */,
 				A74322AB22B900F00017C367 /* CommunityFindFriendsView.swift in Sources */,
 				BD3474F522857B85000908C5 /* CommonPayHeader.swift in Sources */,
@@ -6495,7 +6423,6 @@
 				A770E61522D6625700CBD0A4 /* ShareView.swift in Sources */,
 				A7F2D6D722B1ED370093000B /* CardContentUserTableViewCell.swift in Sources */,
 				A7CC751A22716254003C4F38 /* SetTableViewCell.swift in Sources */,
-				A7AD27812310D1E40099B3E0 /* TLPhotopickerProtocol.swift in Sources */,
 				BD20F1D32283D0ED00677D8E /* OrderFinishPaySuccessCell.swift in Sources */,
 				A7E19FAC22BA2D01009BCCE1 /* SearchTopicListViewController.swift in Sources */,
 				A71AA52822732173008FF1A5 /* SwiftMoyaNetWorkServiceConfig.swift in Sources */,
@@ -6503,7 +6430,6 @@
 				A70B2C4322883B4E00B2449F /* ProductDetailShopTableViewCell.swift in Sources */,
 				A70B2C102286A3BC00B2449F /* ProductDetailModel.swift in Sources */,
 				A7A17E5F22A0CEF200B7A77E /* SwiftMoyaNetWorkManagerTools.swift in Sources */,
-				A7AD278F2310D51F0099B3E0 /* PhotoCaptureDelegate.swift in Sources */,
 				A72A72A922321DE000B21995 /* NumberKeyboard.swift in Sources */,
 				BD108C9422A60C2100837DAB /* HGImageCollectionViewController.swift in Sources */,
 				A70B2C272286C5D600B2449F /* ProductDetailFSPagerViewCell.swift in Sources */,
@@ -6553,7 +6479,6 @@
 				A7A98E09227EB8DD005306E9 /* CategoryView.swift in Sources */,
 				A75B782A22DEC8B3007B986A /* RedemptionAreaSpecialTwoTableViewCell.swift in Sources */,
 				BD0F61F822CAFC8B004650FB /* CommunityVideoAuthModel.swift in Sources */,
-				A7AD278A2310D44B0099B3E0 /* CustomCameraCell.swift in Sources */,
 				A7D07CC122B73F0200186014 /* OtherPersonalCenterViewController.swift in Sources */,
 				A7CC75362271AC14003C4F38 /* AddressManagerView.swift in Sources */,
 				A7146349228EFCE20066099B /* ORSKUDataFilter.m in Sources */,
@@ -6606,7 +6531,6 @@
 				A76068F322E4B11B008DF18F /* UIImage+Gif.swift in Sources */,
 				A775CBFE2237493600EBDCF8 /* ShoppingMallNavigationBarView.swift in Sources */,
 				A71AA5212272E527008FF1A5 /* Extension+UINavigationController.swift in Sources */,
-				A7AD27822310D1E40099B3E0 /* TLCollectionTableViewCell.swift in Sources */,
 				BD981A8F22C9FEEF0043D951 /* CommunityPublishModel.swift in Sources */,
 				A7D5F22D22BB689700F8E9AF /* WKWebViewEnum.swift in Sources */,
 				A7D07CD222B784B800186014 /* UserPersonalCenterHeaderView.swift in Sources */,
@@ -6697,7 +6621,6 @@
 				A70B2C3E228825B100B2449F /* ProductDetailEvaluationTableViewCell.swift in Sources */,
 				A7DAB33322D881F5005B964E /* H5RouterModuleType.swift in Sources */,
 				A7EF3E132303EB7C001E4D26 /* GuidePageView.swift in Sources */,
-				A7AD27852310D1E40099B3E0 /* TLBundle.swift in Sources */,
 				A79057022276C9770037F823 /* SetPasswordModel.swift in Sources */,
 				BD12B68022B4EF2600AEB10B /* KSMediaPickerViewImageCell.swift in Sources */,
 				A7274C5A228EE636000E3A07 /* LBXScanView.swift in Sources */,
@@ -6738,11 +6661,9 @@
 				A71AF0A6226EDDC8001730FE /* SearchViewController.swift in Sources */,
 				BD20F1CF2283CE2300677D8E /* OrderFinishPayView.swift in Sources */,
 				BD13B6DC22BA03BC008BB323 /* SearchAddrNavigationbarView.swift in Sources */,
-				A7AD27922312B7050099B3E0 /* TLPhontoPreviewView.swift in Sources */,
 				A757849D22C1CBF400D4DB61 /* SwiftMoyaNetWorkH5Manager.swift in Sources */,
 				A7C2567E22CD90D700420828 /* CommunityPostReplysModel.swift in Sources */,
 				A7A98E4322804851005306E9 /* ShoppingMallSepcialFlowLayout.swift in Sources */,
-				A7AD27872310D1E40099B3E0 /* TLAlbumPopView.swift in Sources */,
 				BDE376E622C22D2B0055E2EA /* AlivcDefine.m in Sources */,
 				BD12B69422B4F68400AEB10B /* KSMediaPickerCollectionView.m in Sources */,
 				BD12204122AF8E320051C7C2 /* MessagePlanetNotiTableCell.swift in Sources */,
@@ -6754,7 +6675,6 @@
 				A757849F22C1CEA900D4DB61 /* FollowStatusModel.swift in Sources */,
 				A7CC751F227190C5003C4F38 /* AccountSecurityViewController.swift in Sources */,
 				BD13B6C422BA034D008BB323 /* PublishEditDefaultCollectionCell.swift in Sources */,
-				A7AD27882310D1E40099B3E0 /* TLAssetCollection+Extension.swift in Sources */,
 				A770E5E022CF19FA00CBD0A4 /* CommunityRouterModuleType.swift in Sources */,
 				BD29A92E228F99780018CFC3 /* OrderCommentParameterModel.swift in Sources */,
 				A7284440224DFACD00F82F30 /* InfoModel.swift in Sources */,

+ 0 - 318
RainbowPlanet/RainbowPlanet/Modules/PublishModule/PhotoPicker/TLPhotoPicker/CustomCameraCell.swift

@@ -1,318 +0,0 @@
-//
-//  CustomCameraCell.swift
-//  TLPhotoPicker_Example
-//
-//  Created by wade.hawk on 2017. 10. 27..
-//  Copyright © 2017년 CocoaPods. All rights reserved.
-//
-
-import Foundation
-import AVFoundation
-import Photos
-
-@available(iOS 10.2, *)
-class CustomCameraCell: TLPhotoCollectionViewCell, AVCaptureFileOutputRecordingDelegate {
-    // MARK: Session Management
-    private enum SessionSetupResult {
-        case success
-        case notAuthorized
-        case configurationFailed
-    }
-    
-    private let session = AVCaptureSession()
-    private var isSessionRunning = false
-    private let sessionQueue = DispatchQueue(label: "session queue") // Communicate with the session and other session objects on this queue.
-    private var setupResult: SessionSetupResult = .success
-    var videoDeviceInput: AVCaptureDeviceInput!
-    
-    @IBOutlet private weak var previewView: PreviewView!
-    override func awakeFromNib() {
-        super.awakeFromNib()
-        if Platform.isSimulator {
-            return
-        }
-        previewView.session = session
-        /*
-         Check video authorization status. Video access is required and audio
-         access is optional. If audio access is denied, audio is not recorded
-         during movie recording.
-         */
-        switch AVCaptureDevice.authorizationStatus(for: .video) {
-        case .authorized:
-            // The user has previously granted access to the camera.
-            break
-            
-        case .notDetermined:
-            /*
-             The user has not yet been presented with the option to grant
-             video access. We suspend the session queue to delay session
-             setup until the access request has completed.
-             
-             Note that audio access will be implicitly requested when we
-             create an AVCaptureDeviceInput for audio during session setup.
-             */
-            sessionQueue.suspend()
-            AVCaptureDevice.requestAccess(for: .video, completionHandler: { granted in
-                if !granted {
-                    self.setupResult = .notAuthorized
-                }
-                self.sessionQueue.resume()
-            })
-            
-        default:
-            // The user has previously denied access.
-            setupResult = .notAuthorized
-        }
-        
-        /*
-         Setup the capture session.
-         In general it is not safe to mutate an AVCaptureSession or any of its
-         inputs, outputs, or connections from multiple threads at the same time.
-         
-         Why not do all of this on the main queue?
-         Because AVCaptureSession.startRunning() is a blocking call which can
-         take a long time. We dispatch session setup to the sessionQueue so
-         that the main queue isn't blocked, which keeps the UI responsive.
-         */
-        sessionQueue.async {
-            self.configureSession()
-        }
-    }
-    
-    override func willDisplayCell() {
-        super.willDisplayCell()
-        if Platform.isSimulator {
-            return
-        }
-        sessionQueue.async { [weak self] in
-            guard let `self` = self else { return }
-            switch self.setupResult {
-            case .success:
-                // Only setup observers and start the session running if setup succeeded.
-                self.session.startRunning()
-                self.isSessionRunning = self.session.isRunning
-            default:
-                break
-            }
-        }
-    }
-    
-    override func endDisplayingCell() {
-        if Platform.isSimulator {
-            return
-        }
-        sessionQueue.async { [weak self] in
-            guard let `self` = self else { return }
-            if self.setupResult == .success {
-                self.session.stopRunning()
-                self.isSessionRunning = self.session.isRunning
-            }
-        }
-        super.endDisplayingCell()
-    }
-    
-    // Call this on the session queue.
-    private func configureSession() {
-        if setupResult != .success {
-            return
-        }
-        
-        session.beginConfiguration()
-        session.sessionPreset = .photo
-        do {
-            var defaultVideoDevice: AVCaptureDevice?
-            
-            // Choose the back dual camera if available, otherwise default to a wide angle camera.
-            if let dualCameraDevice = AVCaptureDevice.default(.builtInDualCamera, for: .video, position: .back) {
-                defaultVideoDevice = dualCameraDevice
-            } else if let backCameraDevice = AVCaptureDevice.default(.builtInWideAngleCamera, for: .video, position: .back) {
-                // If the back dual camera is not available, default to the back wide angle camera.
-                defaultVideoDevice = backCameraDevice
-            } else if let frontCameraDevice = AVCaptureDevice.default(.builtInWideAngleCamera, for: .video, position: .front) {
-                /*
-                 In some cases where users break their phones, the back wide angle camera is not available.
-                 In this case, we should default to the front wide angle camera.
-                 */
-                defaultVideoDevice = frontCameraDevice
-            }
-            
-            let videoDeviceInput = try AVCaptureDeviceInput(device: defaultVideoDevice!)
-            
-            if session.canAddInput(videoDeviceInput) {
-                session.addInput(videoDeviceInput)
-                self.videoDeviceInput = videoDeviceInput
-                
-                DispatchQueue.main.async {
-                    /*
-                     Why are we dispatching this to the main queue?
-                     Because AVCaptureVideoPreviewLayer is the backing layer for PreviewView and UIView
-                     can only be manipulated on the main thread.
-                     Note: As an exception to the above rule, it is not necessary to serialize video orientation changes
-                     on the AVCaptureVideoPreviewLayer’s connection with other session manipulation.
-                     
-                     Use the status bar orientation as the initial video orientation. Subsequent orientation changes are
-                     handled by CameraViewController.viewWillTransition(to:with:).
-                     */
-                    let statusBarOrientation = UIApplication.shared.statusBarOrientation
-                    var initialVideoOrientation: AVCaptureVideoOrientation = .portrait
-                    if statusBarOrientation != .unknown {
-                        if let videoOrientation = AVCaptureVideoOrientation(rawValue: statusBarOrientation.rawValue) {
-                            initialVideoOrientation = videoOrientation
-                        }
-                    }
-                    self.previewView.videoPreviewLayer.connection?.videoOrientation = initialVideoOrientation
-                }
-            } else {
-                print("Could not add video device input to the session")
-                setupResult = .configurationFailed
-                session.commitConfiguration()
-                return
-            }
-        } catch {
-            print("Could not create video device input: \(error)")
-            setupResult = .configurationFailed
-            session.commitConfiguration()
-            return
-        }
-        // Add photo output.
-        if session.canAddOutput(photoOutput) {
-            session.addOutput(photoOutput)
-            photoOutput.isHighResolutionCaptureEnabled = true
-        } else {
-            print("Could not add photo output to the session")
-            setupResult = .configurationFailed
-            session.commitConfiguration()
-            return
-        }
-        
-        session.commitConfiguration()
-    }
-    
-    private enum CaptureMode: Int {
-        case photo = 0
-        case movie = 1
-    }
-    
-    // MARK: Device Configuration
-    let videoDeviceDiscoverySession = AVCaptureDevice.DiscoverySession(deviceTypes: [.builtInWideAngleCamera, .builtInDualCamera],
-                                                                               mediaType: .video, position: .unspecified)
-
-    // MARK: Capturing Photos
-    
-
-    let photoOutput = AVCapturePhotoOutput()
-    
-    var inProgressPhotoCaptureDelegates = [Int64: PhotoCaptureProcessor]()
-
-    override func selectedCell() {
-        let videoPreviewLayerOrientation = previewView.videoPreviewLayer.connection?.videoOrientation
-        
-        sessionQueue.async {
-            // Update the photo output's connection to match the video orientation of the video preview layer.
-            if let photoOutputConnection = self.photoOutput.connection(with: .video) {
-                photoOutputConnection.videoOrientation = videoPreviewLayerOrientation!
-            }
-            
-            var photoSettings = AVCapturePhotoSettings()
-            // Capture HEIF photo when supported, with flash set to auto and high resolution photo enabled.
-            if #available(iOS 11.0, *) {
-                if  self.photoOutput.availablePhotoCodecTypes.contains(.hevc) {
-                    photoSettings = AVCapturePhotoSettings(format: [AVVideoCodecKey: AVVideoCodecType.hevc])
-                }
-            } else {
-                // Fallback on earlier versions
-            }
-            
-            if self.videoDeviceInput.device.isFlashAvailable {
-                photoSettings.flashMode = .auto
-            }
-            
-            photoSettings.isHighResolutionPhotoEnabled = true
-            if !photoSettings.__availablePreviewPhotoPixelFormatTypes.isEmpty {
-                photoSettings.previewPhotoFormat = [kCVPixelBufferPixelFormatTypeKey as String: photoSettings.__availablePreviewPhotoPixelFormatTypes.first!]
-            }
-            
-            // Use a separate object for the photo capture delegate to isolate each capture life cycle.
-            let photoCaptureProcessor = PhotoCaptureProcessor(with: photoSettings, willCapturePhotoAnimation: {
-                DispatchQueue.main.async {
-                    self.previewView.videoPreviewLayer.opacity = 0
-                    UIView.animate(withDuration: 0.25) {
-                        self.previewView.videoPreviewLayer.opacity = 1
-                    }
-                }
-            }, livePhotoCaptureHandler: { capturing in
-            }, completionHandler: { photoCaptureProcessor in
-                // When the capture is complete, remove a reference to the photo capture delegate so it can be deallocated.
-                self.sessionQueue.async {
-                    self.inProgressPhotoCaptureDelegates[photoCaptureProcessor.requestedPhotoSettings.uniqueID] = nil
-                }
-            })
-            self.inProgressPhotoCaptureDelegates[photoCaptureProcessor.requestedPhotoSettings.uniqueID] = photoCaptureProcessor
-            self.photoOutput.capturePhoto(with: photoSettings, delegate: photoCaptureProcessor)
-        }
-    }
-
-    func fileOutput(_ output: AVCaptureFileOutput, didStartRecordingTo fileURL: URL, from connections: [AVCaptureConnection]) {
-        // Enable the Record button to let the user stop the recording.
-    }
-
-    func fileOutput(_ output: AVCaptureFileOutput, didFinishRecordingTo outputFileURL: URL, from connections: [AVCaptureConnection], error: Error?) {
-        func cleanUp() {
-            let path = outputFileURL.path
-            if FileManager.default.fileExists(atPath: path) {
-                do {
-                    try FileManager.default.removeItem(atPath: path)
-                } catch {
-                    print("Could not remove file at url: \(outputFileURL)")
-                }
-            }
-        }
-        
-        var success = true
-        
-        if error != nil {
-            print("Movie file finishing error: \(String(describing: error))")
-            success = (((error! as NSError).userInfo[AVErrorRecordingSuccessfullyFinishedKey] as AnyObject).boolValue)!
-        }
-        
-        if success {
-            // Check authorization status.
-            PHPhotoLibrary.requestAuthorization { status in
-                if status == .authorized {
-                    // Save the movie file to the photo library and cleanup.
-                    PHPhotoLibrary.shared().performChanges({
-                        let options = PHAssetResourceCreationOptions()
-                        options.shouldMoveFile = true
-                        let creationRequest = PHAssetCreationRequest.forAsset()
-                        creationRequest.addResource(with: .video, fileURL: outputFileURL, options: options)
-                    }, completionHandler: { success, error in
-                        if !success {
-                            print("Could not save movie to photo library: \(String(describing: error))")
-                        }
-                        cleanUp()
-                    }
-                    )
-                } else {
-                    cleanUp()
-                }
-            }
-        } else {
-            cleanUp()
-        }
-    }
-}
-
-@available(iOS 10.0, *)
-extension AVCaptureDevice.DiscoverySession {
-    var uniqueDevicePositionsCount: Int {
-        var uniqueDevicePositions: [AVCaptureDevice.Position] = []
-        
-        for device in devices {
-            if !uniqueDevicePositions.contains(device.position) {
-                uniqueDevicePositions.append(device.position)
-            }
-        }
-        
-        return uniqueDevicePositions.count
-    }
-}

+ 0 - 174
RainbowPlanet/RainbowPlanet/Modules/PublishModule/PhotoPicker/TLPhotoPicker/PhotoCaptureDelegate.swift

@@ -1,174 +0,0 @@
-/*
- See LICENSE.txt for this sample’s licensing information.
- Sample code project: AVCam-iOS: Using AVFoundation to Capture Images and Movies
- Version: 7.1
- 
- IMPORTANT:  This Apple software is supplied to you by Apple
- Inc. ("Apple") in consideration of your agreement to the following
- terms, and your use, installation, modification or redistribution of
- this Apple software constitutes acceptance of these terms.  If you do
- not agree with these terms, please do not use, install, modify or
- redistribute this Apple software.
- 
- In consideration of your agreement to abide by the following terms, and
- subject to these terms, Apple grants you a personal, non-exclusive
- license, under Apple's copyrights in this original Apple software (the
- "Apple Software"), to use, reproduce, modify and redistribute the Apple
- Software, with or without modifications, in source and/or binary forms;
- provided that if you redistribute the Apple Software in its entirety and
- without modifications, you must retain this notice and the following
- text and disclaimers in all such redistributions of the Apple Software.
- Neither the name, trademarks, service marks or logos of Apple Inc. may
- be used to endorse or promote products derived from the Apple Software
- without specific prior written permission from Apple.  Except as
- expressly stated in this notice, no other rights or licenses, express or
- implied, are granted by Apple herein, including but not limited to any
- patent rights that may be infringed by your derivative works or by other
- works in which the Apple Software may be incorporated.
- 
- The Apple Software is provided by Apple on an "AS IS" basis.  APPLE
- MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
- THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS
- FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND
- OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS.
- 
- IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION,
- MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED
- AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE),
- STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- 
- Copyright (C) 2017 Apple Inc. All Rights Reserved.
- 
- Abstract:
- Application preview view.
- */
-import AVFoundation
-import Photos
-
-@available(iOS 10.2, *)
-class PhotoCaptureProcessor: NSObject {
-    private(set) var requestedPhotoSettings: AVCapturePhotoSettings
-    
-    private let willCapturePhotoAnimation: () -> Void
-    
-    private let livePhotoCaptureHandler: (Bool) -> Void
-    
-    private let completionHandler: (PhotoCaptureProcessor) -> Void
-    
-    private var photoData: Data?
-    
-    private var livePhotoCompanionMovieURL: URL?
-    
-    init(with requestedPhotoSettings: AVCapturePhotoSettings,
-         willCapturePhotoAnimation: @escaping () -> Void,
-         livePhotoCaptureHandler: @escaping (Bool) -> Void,
-         completionHandler: @escaping (PhotoCaptureProcessor) -> Void) {
-        self.requestedPhotoSettings = requestedPhotoSettings
-        self.willCapturePhotoAnimation = willCapturePhotoAnimation
-        self.livePhotoCaptureHandler = livePhotoCaptureHandler
-        self.completionHandler = completionHandler
-    }
-    
-    private func didFinish() {
-        if let livePhotoCompanionMoviePath = livePhotoCompanionMovieURL?.path {
-            if FileManager.default.fileExists(atPath: livePhotoCompanionMoviePath) {
-                do {
-                    try FileManager.default.removeItem(atPath: livePhotoCompanionMoviePath)
-                } catch {
-                    print("Could not remove file at url: \(livePhotoCompanionMoviePath)")
-                }
-            }
-        }
-        
-        completionHandler(self)
-    }
-    
-}
-
-@available(iOS 10.2, *)
-extension PhotoCaptureProcessor: AVCapturePhotoCaptureDelegate {
-    /*
-     This extension includes all the delegate callbacks for AVCapturePhotoCaptureDelegate protocol
-     */
-    
-    func photoOutput(_ output: AVCapturePhotoOutput, willBeginCaptureFor resolvedSettings: AVCaptureResolvedPhotoSettings) {
-        if resolvedSettings.livePhotoMovieDimensions.width > 0 && resolvedSettings.livePhotoMovieDimensions.height > 0 {
-            livePhotoCaptureHandler(true)
-        }
-    }
-    
-    func photoOutput(_ output: AVCapturePhotoOutput, willCapturePhotoFor resolvedSettings: AVCaptureResolvedPhotoSettings) {
-        willCapturePhotoAnimation()
-    }
-    
-    @available(iOS 11.0, *)
-    func photoOutput(_ output: AVCapturePhotoOutput, didFinishProcessingPhoto photo: AVCapturePhoto, error: Error?) {
-        
-        if let error = error {
-            print("Error capturing photo: \(error)")
-        } else {
-            photoData = photo.fileDataRepresentation()
-        }
-    }
-    func photoOutput(_ output: AVCapturePhotoOutput, didFinishRecordingLivePhotoMovieForEventualFileAt outputFileURL: URL, resolvedSettings: AVCaptureResolvedPhotoSettings) {
-        livePhotoCaptureHandler(false)
-    }
-    
-    func photoOutput(_ output: AVCapturePhotoOutput, didFinishProcessingLivePhotoToMovieFileAt outputFileURL: URL, duration: CMTime, photoDisplayTime: CMTime, resolvedSettings: AVCaptureResolvedPhotoSettings, error: Error?) {
-        if error != nil {
-            print("Error processing live photo companion movie: \(String(describing: error))")
-            return
-        }
-        livePhotoCompanionMovieURL = outputFileURL
-    }
-    
-    func photoOutput(_ output: AVCapturePhotoOutput, didFinishCaptureFor resolvedSettings: AVCaptureResolvedPhotoSettings, error: Error?) {
-        if let error = error {
-            print("Error capturing photo: \(error)")
-            didFinish()
-            return
-        }
-        
-        guard let photoData = photoData else {
-            print("No photo data resource")
-            didFinish()
-            return
-        }
-        
-        PHPhotoLibrary.requestAuthorization { status in
-            if status == .authorized {
-                PHPhotoLibrary.shared().performChanges({
-                    let options = PHAssetResourceCreationOptions()
-                    let creationRequest = PHAssetCreationRequest.forAsset()
-                    if #available(iOS 11.0, *) {
-                        options.uniformTypeIdentifier = self.requestedPhotoSettings.processedFileType.map { $0.rawValue }
-                    } else {
-                        // Fallback on earlier versions
-                    }
-                    creationRequest.addResource(with: .photo, data: photoData, options: options)
-                    
-                    if let livePhotoCompanionMovieURL = self.livePhotoCompanionMovieURL {
-                        let livePhotoCompanionMovieFileResourceOptions = PHAssetResourceCreationOptions()
-                        livePhotoCompanionMovieFileResourceOptions.shouldMoveFile = true
-                        creationRequest.addResource(with: .pairedVideo, fileURL: livePhotoCompanionMovieURL, options: livePhotoCompanionMovieFileResourceOptions)
-                    }
-                    
-                }, completionHandler: { _, error in
-                    if let error = error {
-                        print("Error occurered while saving photo to photo library: \(error)")
-                    }
-                    
-                    self.didFinish()
-                }
-                )
-            } else {
-                self.didFinish()
-            }
-        }
-    }
-}
-

+ 0 - 77
RainbowPlanet/RainbowPlanet/Modules/PublishModule/PhotoPicker/TLPhotoPicker/PreviewView.swift

@@ -1,77 +0,0 @@
-/*
- See LICENSE.txt for this sample’s licensing information.
- Sample code project: AVCam-iOS: Using AVFoundation to Capture Images and Movies
- Version: 7.1
- 
- IMPORTANT:  This Apple software is supplied to you by Apple
- Inc. ("Apple") in consideration of your agreement to the following
- terms, and your use, installation, modification or redistribution of
- this Apple software constitutes acceptance of these terms.  If you do
- not agree with these terms, please do not use, install, modify or
- redistribute this Apple software.
- 
- In consideration of your agreement to abide by the following terms, and
- subject to these terms, Apple grants you a personal, non-exclusive
- license, under Apple's copyrights in this original Apple software (the
- "Apple Software"), to use, reproduce, modify and redistribute the Apple
- Software, with or without modifications, in source and/or binary forms;
- provided that if you redistribute the Apple Software in its entirety and
- without modifications, you must retain this notice and the following
- text and disclaimers in all such redistributions of the Apple Software.
- Neither the name, trademarks, service marks or logos of Apple Inc. may
- be used to endorse or promote products derived from the Apple Software
- without specific prior written permission from Apple.  Except as
- expressly stated in this notice, no other rights or licenses, express or
- implied, are granted by Apple herein, including but not limited to any
- patent rights that may be infringed by your derivative works or by other
- works in which the Apple Software may be incorporated.
- 
- The Apple Software is provided by Apple on an "AS IS" basis.  APPLE
- MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
- THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS
- FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND
- OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS.
- 
- IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION,
- MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED
- AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE),
- STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- 
- Copyright (C) 2017 Apple Inc. All Rights Reserved.
-
- Abstract:
- Application preview view.
- */
-
-import UIKit
-import AVFoundation
-
-class PreviewView: UIView {
-    var videoPreviewLayer: AVCaptureVideoPreviewLayer {
-        guard let layer = layer as? AVCaptureVideoPreviewLayer else {
-            fatalError("Expected `AVCaptureVideoPreviewLayer` type for layer. Check PreviewView.layerClass implementation.")
-        }
-        layer.videoGravity = .resizeAspectFill
-        return layer
-    }
-    
-    var session: AVCaptureSession? {
-        get {
-            return videoPreviewLayer.session
-        }
-        set {
-            videoPreviewLayer.session = newValue
-        }
-    }
-    
-    // MARK: UIView
-    
-    override class var layerClass: AnyClass {
-        return AVCaptureVideoPreviewLayer.self
-    }
-}
-

+ 0 - 54
RainbowPlanet/RainbowPlanet/Modules/PublishModule/PhotoPicker/TLPhotoPicker/SynchronizedDictionary.swift

@@ -1,54 +0,0 @@
-//
-//  SynchronizedDictionary.swift
-//  TLPhotoPicker
-//
-//  Created by wade.hawk on 30/03/2019.
-//
-
-import Foundation
-
-public class SynchronizedDictionary<K:Hashable,V> {
-    private var dictionary: [K:V] = [:]
-    private let accessQueue = DispatchQueue(label: "SynchronizedDictionaryAccess",
-                                            attributes: .concurrent)
-    
-    deinit {
-        //print("deinit SynchronizedDictionary")
-    }
-    
-    public func removeAll() {
-        self.accessQueue.async(flags:.barrier) {
-            self.dictionary.removeAll()
-        }
-    }
-    
-    public func removeValue(forKey: K) {
-        self.accessQueue.async(flags:.barrier) {
-            self.dictionary.removeValue(forKey: forKey)
-        }
-    }
-    
-    public func forEach(_ closure: ((K,V) -> Void)) {
-        self.accessQueue.sync {
-            self.dictionary.forEach{ arg in
-                let (key, value) = arg
-                closure(key,value)
-            }
-        }
-    }
-    
-    public subscript(key: K) -> V? {
-        set {
-            self.accessQueue.async(flags:.barrier) {
-                self.dictionary[key] = newValue
-            }
-        }
-        get {
-            var element: V?
-            self.accessQueue.sync {
-                element = self.dictionary[key]
-            }
-            return element
-        }
-    }
-}

+ 0 - 78
RainbowPlanet/RainbowPlanet/Modules/PublishModule/PhotoPicker/TLPhotoPicker/TLAlbumPopView.swift

@@ -1,78 +0,0 @@
-//
-//  TLAlbumPopView.swift
-//  TLPhotosPicker
-//
-//  Created by wade.hawk on 2017. 4. 19..
-//  Copyright © 2017년 wade.hawk. All rights reserved.
-//
-
-import UIKit
-
-protocol PopupViewProtocol: class {
-    var bgView: UIView! { get set }
-    var popupView: UIView! { get set }
-    var originalFrame: CGRect { get set }
-    var show: Bool { get set }
-    func setupPopupFrame()
-}
-
-extension PopupViewProtocol where Self: UIView {
-    fileprivate func getFrame(scale: CGFloat) -> CGRect {
-        var frame = self.originalFrame
-        frame.size.width = frame.size.width * scale
-        frame.size.height = frame.size.height * scale
-        frame.origin.x = self.frame.width/2 - frame.width/2
-        return frame
-    }
-    func setupPopupFrame() {
-        if self.originalFrame != self.popupView.frame {
-            self.originalFrame = self.popupView.frame
-        }
-    }
-    func show(_ show: Bool, duration: TimeInterval = 0.1) {
-        guard self.show != show else { return }
-        self.layer.removeAllAnimations()
-        self.isHidden = false
-        self.popupView.frame = show ? getFrame(scale: 0.1) : self.popupView.frame
-        self.bgView.alpha = show ? 0 : 1
-        UIView.animate(withDuration: duration, animations: {
-            self.bgView.alpha = show ? 1 : 0
-            self.popupView.transform = show ? CGAffineTransform(scaleX: 1.05, y: 1.05) : CGAffineTransform(scaleX: 0.1, y: 0.1)
-            self.popupView.frame = show ? self.getFrame(scale: 1.05) : self.getFrame(scale: 0.1)
-        }) { _ in
-            self.isHidden = show ? false : true
-            UIView.animate(withDuration: duration) {
-                if show {
-                    self.popupView.transform = CGAffineTransform(scaleX: 1, y: 1)
-                    self.popupView.frame = self.originalFrame
-                }
-                self.show = show
-            }
-        }
-    }
-}
-
-open class TLAlbumPopView: UIView,PopupViewProtocol {
-    @IBOutlet open var bgView: UIView!
-    @IBOutlet open var popupView: UIView!
-    @IBOutlet var popupViewHeight: NSLayoutConstraint!
-    @IBOutlet open var tableView: UITableView!
-    @objc var originalFrame = CGRect.zero
-    @objc var show = false
-    
-    deinit {
-//        print("deinit TLAlbumPopView")
-    }
-    
-    override open func awakeFromNib() {
-        super.awakeFromNib()
-        self.popupView.layer.cornerRadius = 5.0
-        let tapGesture = UITapGestureRecognizer(target: self, action: #selector(tapBgView))
-        self.bgView.addGestureRecognizer(tapGesture)
-        self.tableView.register(UINib(nibName: "TLCollectionTableViewCell", bundle: TLBundle.bundle()), forCellReuseIdentifier: "TLCollectionTableViewCell")
-    }
-    
-    @objc func tapBgView() {
-        self.show(false)
-    }
-}

+ 0 - 68
RainbowPlanet/RainbowPlanet/Modules/PublishModule/PhotoPicker/TLPhotoPicker/TLAssetCollection+Extension.swift

@@ -1,68 +0,0 @@
-//
-//  TLAssetCollection+Extension.swift
-//  TLPhotoPicker
-//
-//  Created by wade.hawk on 21/01/2019.
-//
-
-import Foundation
-import Photos
-
-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
-        }
-    }
-}
-
-extension TLAssetsCollection {
-    func enumarateFetchResult(groupedBy: PHFetchedResultGroupedBy) -> Dictionary<String,[TLPHAsset]> {
-        let dateFormatter = DateFormatter()
-        dateFormatter.dateFormat = groupedBy.dateFormat
-        var assets = [PHAsset]()
-        assets.reserveCapacity(self.fetchResult?.count ?? 0)
-        self.fetchResult?.enumerateObjects({ (phAsset, idx, stop) in
-            if phAsset.creationDate != nil {
-                assets.append(phAsset)
-            }
-        })
-        let sections = Dictionary(grouping: assets.map{ TLPHAsset(asset: $0) }) { (element) -> String in
-            if let creationDate = element.phAsset?.creationDate {
-                let identifier = dateFormatter.string(from: creationDate)
-                return identifier
-            }
-            return ""
-        }
-        return sections
-    }
-
-    func section(groupedBy: PHFetchedResultGroupedBy) -> [(String,[TLPHAsset])] {
-        let dict = enumarateFetchResult(groupedBy: groupedBy)
-        var sections = [(String,[TLPHAsset])]()
-        let sortedKeys = dict.keys.sorted(by: >)
-        for key in sortedKeys {
-            if let array = dict[key] {
-                sections.append((key, array))
-            }
-        }
-        return sections
-    }
-}

+ 0 - 370
RainbowPlanet/RainbowPlanet/Modules/PublishModule/PhotoPicker/TLPhotoPicker/TLAssetsCollection.swift

@@ -1,370 +0,0 @@
-//
-//  TLAssetsCollection.swift
-//  TLPhotosPicker
-//
-//  Created by wade.hawk on 2017. 4. 18..
-//  Copyright © 2017년 wade.hawk. All rights reserved.
-//
-
-import Foundation
-import Photos
-import PhotosUI
-import MobileCoreServices
-
-public struct TLPHAsset {
-    enum CloudDownloadState {
-        case ready, progress, complete, failed
-    }
-    
-    public enum AssetType {
-        case photo, video, livePhoto
-    }
-    
-    public enum ImageExtType: String {
-        case png, jpg, gif, heic
-    }
-    
-    var state = CloudDownloadState.ready
-    public var phAsset: PHAsset? = nil
-    //Bool to check if TLPHAsset returned is created using camera.
-    public var isSelectedFromCamera = false
-    public var selectedOrder: Int = 0
-    public var type: AssetType {
-        get {
-            guard let phAsset = self.phAsset else { return .photo }
-            if phAsset.mediaSubtypes.contains(.photoLive) {
-                return .livePhoto
-            }else if phAsset.mediaType == .video {
-                return .video
-            }else {
-                return .photo
-            }
-        }
-    }
-    
-    public var fullResolutionImage: UIImage? {
-        get {
-            guard let phAsset = self.phAsset else { return nil }
-            return TLPhotoLibrary.fullResolutionImageData(asset: phAsset)
-        }
-    }
-    
-    public func extType() -> ImageExtType {
-        var ext = ImageExtType.png
-        if let fileName = self.originalFileName, let extention = URL(string: fileName)?.pathExtension.lowercased() {
-            ext = ImageExtType(rawValue: extention) ?? .png
-        }
-        return ext
-    }
-    
-    @discardableResult
-    public func cloudImageDownload(progressBlock: @escaping (Double) -> Void, completionBlock:@escaping (UIImage?)-> Void ) -> PHImageRequestID? {
-        guard let phAsset = self.phAsset else { return nil }
-        return TLPhotoLibrary.cloudImageDownload(asset: phAsset, progressBlock: progressBlock, completionBlock: completionBlock)
-    }
-    
-    public var originalFileName: String? {
-        get {
-            guard let phAsset = self.phAsset,let resource = PHAssetResource.assetResources(for: phAsset).first else { return nil }
-            return resource.originalFilename
-        }
-    }
-    
-    public func photoSize(options: PHImageRequestOptions? = nil ,completion: @escaping ((Int)->Void), livePhotoVideoSize: Bool = false) {
-        guard let phAsset = self.phAsset, self.type == .photo else { completion(-1); return }
-        var resource: PHAssetResource? = nil
-        if phAsset.mediaSubtypes.contains(.photoLive) == true, livePhotoVideoSize {
-            resource = PHAssetResource.assetResources(for: phAsset).filter { $0.type == .pairedVideo }.first
-        }else {
-            resource = PHAssetResource.assetResources(for: phAsset).filter { $0.type == .photo }.first
-        }
-        if let fileSize = resource?.value(forKey: "fileSize") as? Int {
-            completion(fileSize)
-        }else {
-            PHImageManager.default().requestImageData(for: phAsset, options: nil) { (data, uti, orientation, info) in
-                var fileSize = -1
-                if let data = data {
-                    let bcf = ByteCountFormatter()
-                    bcf.countStyle = .file
-                    fileSize = data.count
-                }
-                DispatchQueue.main.async {
-                    completion(fileSize)
-                }
-            }
-        }
-    }
-    
-    public func videoSize(options: PHVideoRequestOptions? = nil, completion: @escaping ((Int)->Void)) {
-        guard let phAsset = self.phAsset, self.type == .video else {  completion(-1); return }
-        let resource = PHAssetResource.assetResources(for: phAsset).filter { $0.type == .video }.first
-        if let fileSize = resource?.value(forKey: "fileSize") as? Int {
-            completion(fileSize)
-        }else {
-            PHImageManager.default().requestAVAsset(forVideo: phAsset, options: options) { (avasset, audioMix, info) in
-                func fileSize(_ url: URL?) -> Int? {
-                    do {
-                        guard let fileSize = try url?.resourceValues(forKeys: [.fileSizeKey]).fileSize else { return nil }
-                        return fileSize
-                    }catch { return nil }
-                }
-                var url: URL? = nil
-                if let urlAsset = avasset as? AVURLAsset {
-                    url = urlAsset.url
-                }else if let sandboxKeys = info?["PHImageFileSandboxExtensionTokenKey"] as? String, let path = sandboxKeys.components(separatedBy: ";").last {
-                    url = URL(fileURLWithPath: path)
-                }
-                let size = fileSize(url) ?? -1
-                DispatchQueue.main.async {
-                    completion(size)
-                }
-            }
-        }
-    }
-    
-    func MIMEType(_ url: URL?) -> String? {
-        guard let ext = url?.pathExtension else { return nil }
-        if !ext.isEmpty {
-            let UTIRef = UTTypeCreatePreferredIdentifierForTag("public.filename-extension" as CFString, ext as CFString, nil)
-            let UTI = UTIRef?.takeUnretainedValue()
-            UTIRef?.release()
-            if let UTI = UTI {
-                guard let MIMETypeRef = UTTypeCopyPreferredTagWithClass(UTI, kUTTagClassMIMEType) else { return nil }
-                let MIMEType = MIMETypeRef.takeUnretainedValue()
-                MIMETypeRef.release()
-                return MIMEType as String
-            }
-        }
-        return nil
-    }
-    
-    @discardableResult
-    //convertLivePhotosToJPG
-    // false : If you want mov file at live photos
-    // true  : If you want png file at live photos ( HEIC )
-    public func tempCopyMediaFile(videoRequestOptions: PHVideoRequestOptions? = nil, imageRequestOptions: PHImageRequestOptions? = nil, exportPreset: String = AVAssetExportPresetHighestQuality, convertLivePhotosToJPG: Bool = false, progressBlock:((Double) -> Void)? = nil, completionBlock:@escaping ((URL,String) -> Void)) -> PHImageRequestID? {
-        guard let phAsset = self.phAsset else { return nil }
-        var type: PHAssetResourceType? = nil
-        if phAsset.mediaSubtypes.contains(.photoLive) == true, convertLivePhotosToJPG == false {
-            type = .pairedVideo
-        }else {
-            type = phAsset.mediaType == .video ? .video : .photo
-        }
-        guard let resource = (PHAssetResource.assetResources(for: phAsset).filter{ $0.type == type }).first else { return nil }
-        let fileName = resource.originalFilename
-        var writeURL: URL? = nil
-        if #available(iOS 10.0, *) {
-            writeURL = FileManager.default.temporaryDirectory.appendingPathComponent("\(fileName)")
-        } else {
-            writeURL = URL(fileURLWithPath: NSTemporaryDirectory(), isDirectory: true).appendingPathComponent("\(fileName)")
-        }
-        if (writeURL?.pathExtension.uppercased() == "HEIC" || writeURL?.pathExtension.uppercased() == "HEIF") && convertLivePhotosToJPG {
-            if let fileName2 = writeURL?.deletingPathExtension().lastPathComponent {
-                writeURL?.deleteLastPathComponent()
-                writeURL?.appendPathComponent("\(fileName2).jpg")
-            }
-        }
-        guard let localURL = writeURL,let mimetype = MIMEType(writeURL) else { return nil }
-        switch phAsset.mediaType {
-        case .video:
-            var requestOptions = PHVideoRequestOptions()
-            if let options = videoRequestOptions {
-                requestOptions = options
-            }else {
-                requestOptions.isNetworkAccessAllowed = true
-            }
-            //iCloud download progress
-            requestOptions.progressHandler = { (progress, error, stop, info) in
-                DispatchQueue.main.async {
-                    progressBlock?(progress)
-                }
-            }
-            return PHImageManager.default().requestExportSession(forVideo: phAsset, options: requestOptions, exportPreset: exportPreset) { (session, infoDict) in
-                session?.outputURL = localURL
-                session?.outputFileType = AVFileType.mov
-                session?.exportAsynchronously(completionHandler: {
-                    DispatchQueue.main.async {
-                        completionBlock(localURL, mimetype)
-                    }
-                })
-            }
-        case .image:
-            var requestOptions = PHImageRequestOptions()
-            if let options = imageRequestOptions {
-                requestOptions = options
-            }else {
-                requestOptions.isNetworkAccessAllowed = true
-            }
-            //iCloud download progress
-            requestOptions.progressHandler = { (progress, error, stop, info) in
-                DispatchQueue.main.async {
-                    progressBlock?(progress)
-                }
-            }
-            return PHImageManager.default().requestImageData(for: phAsset, options: requestOptions, resultHandler: { (data, uti, orientation, info) in
-                do {
-                    var data = data
-                    let needConvertLivePhotoToJPG = phAsset.mediaSubtypes.contains(.photoLive) == true && convertLivePhotosToJPG == true
-                    if needConvertLivePhotoToJPG, let imgData = data, let rawImage = UIImage(data: imgData)?.upOrientationImage() {
-                        data = rawImage.jpegData(compressionQuality: 1)
-                    }
-                    try data?.write(to: localURL)
-                    DispatchQueue.main.async {
-                        completionBlock(localURL, mimetype)
-                    }
-                }catch { }
-            })
-        default:
-            return nil
-        }
-    }
-    
-    private func videoFilename(phAsset: PHAsset) -> URL? {
-        guard let resource = (PHAssetResource.assetResources(for: phAsset).filter{ $0.type == .video }).first else {
-            return nil
-        }
-        var writeURL: URL?
-        let fileName = resource.originalFilename
-        if #available(iOS 10.0, *) {
-            writeURL = FileManager.default.temporaryDirectory.appendingPathComponent("\(fileName)")
-        } else {
-            writeURL = URL(fileURLWithPath: NSTemporaryDirectory(), isDirectory: true).appendingPathComponent("\(fileName)")
-        }
-        return writeURL
-    }
-    
-    //Apparently, This is not the only way to export video.
-    //There is many way that export a video.
-    //This method was one of them.
-    public func exportVideoFile(options: PHVideoRequestOptions? = nil,
-                                outputURL: URL? = nil,
-                                outputFileType: AVFileType = .mov,
-                                progressBlock:((Double) -> Void)? = nil,
-                                completionBlock:@escaping ((URL,String) -> Void)) {
-        guard
-            let phAsset = self.phAsset,
-            phAsset.mediaType == .video,
-            let writeURL = outputURL ?? videoFilename(phAsset: phAsset),
-            let mimetype = MIMEType(writeURL)
-            else {
-                return
-        }
-        var requestOptions = PHVideoRequestOptions()
-        if let options = options {
-            requestOptions = options
-        }else {
-            requestOptions.isNetworkAccessAllowed = true
-        }
-        requestOptions.progressHandler = { (progress, error, stop, info) in
-            DispatchQueue.main.async {
-                progressBlock?(progress)
-            }
-        }
-        PHImageManager.default().requestAVAsset(forVideo: phAsset, options: requestOptions) { (avasset, avaudioMix, infoDict) in
-            guard let avasset = avasset else {
-                return
-            }
-            let exportSession = AVAssetExportSession.init(asset: avasset, presetName: AVAssetExportPresetHighestQuality)
-            exportSession?.outputURL = writeURL
-            exportSession?.outputFileType = outputFileType
-            exportSession?.exportAsynchronously(completionHandler: {
-                completionBlock(writeURL, mimetype)
-            })
-        }
-    }
-    
-    init(asset: PHAsset?) {
-        self.phAsset = asset
-    }
-
-    public static func asset(with localIdentifier: String) -> TLPHAsset? {
-        let fetchResult = PHAsset.fetchAssets(withLocalIdentifiers: [localIdentifier], options: nil)
-        return TLPHAsset(asset: fetchResult.firstObject)
-    }
-}
-
-extension TLPHAsset: Equatable {
-    public static func ==(lhs: TLPHAsset, rhs: TLPHAsset) -> Bool {
-        guard let lphAsset = lhs.phAsset, let rphAsset = rhs.phAsset else { return false }
-        return lphAsset.localIdentifier == rphAsset.localIdentifier
-    }
-}
-
-extension Array {
-    subscript (safe index: Int) -> Element? {
-        return indices ~= index ? self[index] : nil
-    }
-}
-
-public struct TLAssetsCollection {
-    var phAssetCollection: PHAssetCollection? = nil
-    var fetchResult: PHFetchResult<PHAsset>? = nil
-    var useCameraButton: Bool = false
-    var recentPosition: CGPoint = CGPoint.zero
-    var title: String
-    var localIdentifier: String
-    public var sections: [(title: String, assets: [TLPHAsset])]? = nil
-    var count: Int {
-        get {
-            guard let count = self.fetchResult?.count, count > 0 else { return self.useCameraButton ? 1 : 0 }
-            return count + (self.useCameraButton ? 1 : 0)
-        }
-    }
-    
-    init(collection: PHAssetCollection) {
-        self.phAssetCollection = collection
-        self.title = collection.localizedTitle ?? ""
-        self.localIdentifier = collection.localIdentifier
-    }
-    
-    func getAsset(at index: Int) -> PHAsset? {
-        if self.useCameraButton && index == 0 { return nil }
-        let index = index - (self.useCameraButton ? 1 : 0)
-        guard let result = self.fetchResult, index < result.count else { return nil }
-        return result.object(at: max(index,0))
-    }
-    
-    func getTLAsset(at indexPath: IndexPath) -> TLPHAsset? {
-        let isCameraRow = self.useCameraButton && indexPath.section == 0 && indexPath.row == 0
-        if isCameraRow {
-            return nil
-        }
-        if let sections = self.sections {
-            let index = indexPath.row - ((self.useCameraButton && indexPath.section == 0) ? 1 : 0)
-            let result = sections[safe: indexPath.section]
-            return result?.assets[safe: index]
-        }else {
-            var index = indexPath.row
-            index = index - (self.useCameraButton ? 1 : 0)
-            guard let result = self.fetchResult, index < result.count else { return nil }
-            return TLPHAsset(asset: result.object(at: max(index,0)))
-        }
-    }
-    
-    mutating func reloadSection(groupedBy: PHFetchedResultGroupedBy) {
-        var groupedSections = self.section(groupedBy: groupedBy)
-        if self.useCameraButton {
-            groupedSections.insert(("camera",[TLPHAsset(asset: nil)]), at: 0)
-        }
-        self.sections = groupedSections
-    }
-    
-    static func ==(lhs: TLAssetsCollection, rhs: TLAssetsCollection) -> Bool {
-        return lhs.localIdentifier == rhs.localIdentifier
-    }
-}
-
-extension UIImage {
-    func upOrientationImage() -> UIImage? {
-        switch imageOrientation {
-        case .up:
-            return self
-        default:
-            UIGraphicsBeginImageContextWithOptions(size, false, scale)
-            draw(in: CGRect(origin: .zero, size: size))
-            let result = UIGraphicsGetImageFromCurrentImageContext()
-            UIGraphicsEndImageContext()
-            return result
-        }
-    }
-}

+ 0 - 29
RainbowPlanet/RainbowPlanet/Modules/PublishModule/PhotoPicker/TLPhotoPicker/TLBundle.swift

@@ -1,29 +0,0 @@
-//
-//  TLBundle.swift
-//  Pods
-//
-//  Created by wade.hawk on 2017. 5. 9..
-//
-//
-
-import Foundation
-
-open class TLBundle {
-    open class func podBundleImage(named: String) -> UIImage? {
-        let podBundle = Bundle(for: TLBundle.self)
-        if let url = podBundle.url(forResource: "TLPhotoPickerController", withExtension: "bundle") {
-            let bundle = Bundle(url: url)
-            return UIImage(named: named, in: bundle, compatibleWith: nil)!
-        }
-        return nil
-    }
-    
-    class func bundle() -> Bundle {
-        let podBundle = Bundle(for: TLBundle.self)
-        if let url = podBundle.url(forResource: "TLPhotoPicker", withExtension: "bundle") {
-            let bundle = Bundle(url: url)
-            return bundle ?? podBundle
-        }
-        return podBundle
-    }
-}

+ 0 - 22
RainbowPlanet/RainbowPlanet/Modules/PublishModule/PhotoPicker/TLPhotoPicker/TLCollectionTableViewCell.swift

@@ -1,22 +0,0 @@
-//
-//  TLCollectionTableViewCell.swift
-//  TLPhotosPicker
-//
-//  Created by wade.hawk on 2017. 5. 3..
-//  Copyright © 2017년 wade.hawk. All rights reserved.
-//
-
-import UIKit
-
-open class TLCollectionTableViewCell: UITableViewCell {
-    @IBOutlet open var thumbImageView: UIImageView!
-    @IBOutlet open var titleLabel: UILabel!
-    @IBOutlet open var subTitleLabel: UILabel!
-    
-    override open func awakeFromNib() {
-        super.awakeFromNib()   
-        if #available(iOS 11.0, *) {
-            self.thumbImageView.accessibilityIgnoresInvertColors = true
-        }
-    }
-}

+ 0 - 391
RainbowPlanet/RainbowPlanet/Modules/PublishModule/PhotoPicker/TLPhotoPicker/TLPhontoPreviewView.swift

@@ -1,391 +0,0 @@
-//
-//  TLPhontoPreviewView.swift
-//  RainbowPlanet
-//
-//  Created by 南鑫林 on 2019/8/25.
-//  Copyright © 2019 RainbowPlanet. All rights reserved.
-//
-
-import UIKit
-import PhotosUI
-import Kingfisher
-
-extension TLPhontoPreviewView {
-    
-    private class scrollView: UIScrollView, UIScrollViewDelegate {
-        
-        private enum imageDirection {
-            case equal
-            case transversal
-            case lengthwise
-        }
-        
-        required init?(coder aDecoder: NSCoder) {
-            fatalError("init(coder:) has not been implemented")
-        }
-        
-        public let imageView = UIImageView()
-        
-        override init(frame: CGRect) {
-            super.init(frame: frame)
-            backgroundColor = .clear
-            showsVerticalScrollIndicator = false
-            showsHorizontalScrollIndicator = false
-            alwaysBounceVertical = true
-            alwaysBounceHorizontal = true
-            maximumZoomScale = 3.0
-            clipsToBounds = true
-            if #available(iOS 11.0, *) {
-                contentInsetAdjustmentBehavior = .never
-            }
-            addSubview(imageView)
-            delegate = self
-        }
-        
-        private var _isSquare = false
-        
-        override open var frame: CGRect {
-            set {
-                if frame.size != newValue.size {
-                    let windowSize = newValue.size
-                    _isSquare = floor(windowSize.width) == floor(windowSize.height)
-                    _imageDirection = _imageDirection(from: _imageSize, windowSize)
-                }
-                if _isNeedLayoutSubviews {
-                    zoomScale = 1.0
-                    contentOffset = .zero
-                }
-                super.frame = newValue
-            }
-            get {
-                return super.frame
-            }
-        }
-        
-        private var _isNeedLayoutSubviews = true
-        
-        public func set(frame: CGRect, isNeedLayoutSubviews: Bool) {
-            _isNeedLayoutSubviews = isNeedLayoutSubviews
-            self.frame = frame
-        }
-        
-        open var itemModel: KSMediaPickerItemModel? {
-            didSet {
-                guard let k_itemModel = itemModel else {
-                    return
-                }
-                let asset = k_itemModel.asset
-                let floatWidth = CGFloat(asset.pixelWidth)
-                let floatHeight = CGFloat(asset.pixelHeight)
-                _imageSize = CGSize(width: floatWidth, height: floatHeight)
-            }
-        }
-        
-        var _imageSize = CGSize.zero {
-            didSet {
-                _imageDirection = _imageDirection(from: _imageSize, frame.size)
-                _isNeedLayoutSubviews = true
-                setNeedsLayout()
-            }
-        }
-        
-        override func layoutSubviews() {
-            super.layoutSubviews()
-            guard _isNeedLayoutSubviews || imageView.frame.size == .zero else {
-                return
-            }
-            _isNeedLayoutSubviews = false
-            let offset: CGPoint
-            if _imageDirection == .equal {
-                imageView.frame = bounds
-                offset = .zero
-            } else if _imageSize != .zero {
-                let windowSize = frame.size
-                let windowWidth = windowSize.width
-                let windowHeight = windowSize.height
-                let floatZore = CGFloat(0.0)
-                let viewX: CGFloat
-                let viewY: CGFloat
-                let viewW: CGFloat
-                let viewH: CGFloat
-                
-                let imageWidth = _imageSize.width
-                let imageHeight = _imageSize.height
-                
-                if _imageDirection == .transversal {
-                    viewH = windowHeight
-                    viewW = imageWidth/imageHeight*viewH
-                    viewY = floatZore
-                    viewX = (windowWidth-viewW)*0.5
-                } else {
-                    viewW = windowWidth
-                    viewH = imageHeight/imageWidth*viewW
-                    viewX = floatZore
-                    viewY = (windowHeight-viewH)*0.5
-                }
-                imageView.frame = CGRect(origin: .zero, size: CGSize(width: viewW, height: viewH))
-                offset = CGPoint(x: -viewX, y: -viewY)
-            } else {
-                offset = .zero
-            }
-            contentSize = imageView.frame.size
-            zoomScale = itemModel?.zoomScale ?? 1.0
-            contentOffset = itemModel?.contentOffset ?? offset
-            
-            let minimumZoomScale: CGFloat
-            if _isSquare {
-                switch _imageDirection {
-                case .equal:
-                    minimumZoomScale = 1.0
-                    break
-                case .transversal:
-                    minimumZoomScale = frame.size.width/imageView.frame.size.width
-                    break
-                case .lengthwise:
-                    minimumZoomScale = frame.size.height/imageView.frame.size.height
-                    break
-                }
-            } else {
-                minimumZoomScale = 1.0
-            }
-            self.minimumZoomScale = minimumZoomScale
-        }
-        
-        private func _imageDirection(from imageSize: CGSize, _ superSize: CGSize) -> TLPhontoPreviewView.scrollView.imageDirection {
-            let superWidth = floor(superSize.width)
-            let superHeight = floor(superSize.height)
-            let imageWidth = floor(imageSize.width)
-            let imageHeight = floor(imageSize.height)
-            let constrainImageHeight = floor(imageHeight/imageWidth*superWidth)
-            let dirction: TLPhontoPreviewView.scrollView.imageDirection
-            if superHeight == constrainImageHeight {
-                dirction = .equal
-            } else {
-                let maxHeight = max(superHeight, constrainImageHeight)
-                if maxHeight == superHeight {
-                    dirction = .transversal
-                } else {
-                    dirction = .lengthwise
-                }
-            }
-            return dirction
-        }
-        
-        private var _imageDirection = TLPhontoPreviewView.scrollView.imageDirection.equal
-        
-        func viewForZooming(in scrollView: UIScrollView) -> UIView? {
-            return imageView
-        }
-        
-        func scrollViewDidZoom(_ scrollView: UIScrollView) {
-            let contentSize = scrollView.contentSize
-            let contentSizeWidth = floor(contentSize.width)
-            let contentSizeHeight = floor(contentSize.height)
-            let size = scrollView.frame.size
-            
-            var center = scrollView.center
-            if contentSizeWidth >= floor(size.width) {
-                center.x = contentSizeWidth*0.5
-            }
-            if contentSizeHeight >= floor(size.height) {
-                center.y = contentSizeHeight*0.5
-            }
-            imageView.center = center
-        }
-    }
-}
-
-import Photos
-
-open class TLPhontoPreviewView: UIView {
-    
-    required public init?(coder aDecoder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-    
-    private var _photoLibrary = TLPhotoLibrary()
-    
-    private let _videoView = {() -> KSVideoPlayerBaseView in
-        let videoView = KSVideoPlayerBaseView()
-        videoView.videoGravity = .resizeAspect
-        videoView.videoPlaybackFinished = {[weak videoView] in
-            videoView?.play()
-        }
-        videoView.isHidden = true
-        return videoView
-    }()
-    
-    private let _scrollview = TLPhontoPreviewView.scrollView()
-    
-    private let _changeSizeButton = {() -> UIButton in
-        let changeSizeButton = UIButton(type: .custom)
-        changeSizeButton.setImage(UIImage(named: "icon_mediaPicker_preview_nocut"), for: .normal)
-        changeSizeButton.setImage(UIImage(named: "icon_mediaPicker_preview_cut"), for: .selected)
-        changeSizeButton.backgroundColor = .clear
-        return changeSizeButton
-    }()
-    
-    override public init(frame: CGRect) {
-        super.init(frame: frame)
-        backgroundColor = .black
-        clipsToBounds = true
-        addSubview(_scrollview)
-        
-        _changeSizeButton.addTarget(self, action: #selector(_didClick(changeSizeButton:)), for: .touchUpInside)
-        addSubview(_changeSizeButton)
-        
-        addSubview(_videoView)
-    }
-    
-    override open func layoutSubviews() {
-        super.layoutSubviews()
-        let bounds = self.bounds
-        _videoView.frame = bounds
-        
-        let windowSize = bounds.size
-        let windowWidth = windowSize.width
-        let windowHeight = windowSize.height
-        
-        let scrollviewSize = _scrollview.frame.size
-        var viewW = scrollviewSize.width
-        var viewH = scrollviewSize.height
-        var viewX = (windowWidth-viewW)*0.5
-        var viewY = (windowHeight-viewH)*0.5
-        _scrollview.frame = CGRect(x: viewX, y: viewY, width: viewW, height: viewH)
-        
-        viewW = 30.0
-        viewH = viewW
-        viewX = CGFloat(10.0)
-        viewY = windowHeight-viewH-10.0
-        _changeSizeButton.frame = CGRect(x: viewX, y: viewY, width: viewW, height: viewH)
-        //        _changeSizeButton.layer.cornerRadius = viewH*0.5
-    }
-    
-    @objc private func _didClick(changeSizeButton: UIButton) {
-        let isChangedSize = changeSizeButton.isSelected
-        changeSizeButton.isSelected = !isChangedSize
-        let frame: CGRect
-        if isChangedSize {
-            frame = bounds
-        } else {
-            let windowSize = bounds.size
-            let windowWidth = windowSize.width
-            let windowHeight = windowSize.height
-            
-            let viewW = _minScrollViewSize.width
-            let viewH = _minScrollViewSize.height
-            let viewX = (windowWidth-viewW)*0.5
-            let viewY = (windowHeight-viewH)*0.5
-            frame = CGRect(x: viewX, y: viewY, width: viewW, height: viewH)
-        }
-        UIView.animate(withDuration: 0.2, delay: 0.0, usingSpringWithDamping: 1.0, initialSpringVelocity: 1.0, options: .layoutSubviews, animations: {[weak self] in
-            self?._scrollview.set(frame: frame, isNeedLayoutSubviews: true)
-            }, completion: nil)
-    }
-    
-    static private let _minScale = CGFloat(3.0/4.0)
-    
-    private var _minScrollViewSize = CGSize.zero
-    private var _normalScrollViewSize = CGSize.zero
-    
-    var _asset : TLPHAsset? {
-        didSet {
-            guard let asset = _asset else {
-                return
-            }
-            if asset.type == .video {
-                _videoView.isHidden = false
-                _scrollview.isHidden = true
-                _changeSizeButton.isHidden = true
-                _ = _photoLibrary.videoAsset(asset: asset.phAsset!, size: CGSize(width: kScreenWidth, height: kScreenWidth), progressBlock: { (double, error, unsafeMutablePointer, dict) in
-                    
-                }) { [weak self] (avPlayerItem, dict) in
-                    guard let videoView = self?._videoView else {
-                        return
-                    }
-                    if Thread.current.isMainThread {
-                        videoView.playerItem = avPlayerItem
-                        videoView.play()
-                    } else {
-                        DispatchQueue.main.async {
-                            videoView.playerItem = avPlayerItem
-                            videoView.play()
-                        }
-                    }
-                }
-            }else if asset.type == .photo || asset.type == .livePhoto  {
-                let mainSize = UIScreen.main.bounds.size
-                _videoView.isHidden = true
-                if _videoView.isPlaying {
-                    _videoView.pause()
-                }
-                _scrollview.isHidden = false
-                let pixelWidth = asset.phAsset?.pixelWidth
-                let pixelHeight = asset.phAsset?.pixelHeight
-                
-                _scrollview._imageSize = CGSize(width: pixelWidth ?? 0, height: pixelHeight ?? 0)
-                
-                let windowWidth = mainSize.width
-                if _isStandard {
-                    _normalScrollViewSize = CGSize(width: windowWidth, height: windowWidth)
-                    if pixelWidth == pixelHeight {
-                        _changeSizeButton.isHidden = true
-                        _minScrollViewSize = _normalScrollViewSize
-                    } else {
-                        _changeSizeButton.isHidden = false
-                        let maxWidth = max(pixelHeight ?? 0, pixelWidth ?? 0)
-                        let minScale = TLPhontoPreviewView._minScale
-                        let floatWidth = CGFloat(pixelWidth ?? 0)
-                        let floatHeight = CGFloat(pixelHeight ?? 0)
-                        let scrollViewSize: CGSize
-                        if maxWidth == pixelWidth {//横向
-                            let scale = floatHeight/floatWidth
-                            let minHeight: CGFloat
-                            let minWidth = windowWidth
-                            if scale > minScale {
-                                minHeight = floor(floatHeight*minWidth/floatWidth)
-                            } else {
-                                minHeight = floor(minWidth*minScale)
-                            }
-                            scrollViewSize = CGSize(width: minWidth, height: minHeight)
-                        } else {//纵向
-                            let scale = floatWidth/floatHeight
-                            let minWidth: CGFloat
-                            let minHeight = windowWidth
-                            if scale > minScale {
-                                minWidth = floor(floatWidth*minHeight/floatHeight)
-                            } else {
-                                minWidth = floor(minHeight*minScale)
-                            }
-                            scrollViewSize = CGSize(width: minWidth, height: minHeight)
-                        }
-                        _minScrollViewSize = scrollViewSize
-                    }
-                } else {
-                    _changeSizeButton.isHidden = true
-                }
-                _scrollview.set(frame: CGRect(origin: .zero, size: _changeSizeButton.isSelected ? _minScrollViewSize : _normalScrollViewSize), isNeedLayoutSubviews: true)
-                setNeedsLayout()
-                self._scrollview.imageView.image = asset.fullResolutionImage
-            }
-        }
-    }
-    
-    private var _isStandard = true
-    
-    open var isStandard: Bool {
-        return _isStandard
-    }
-    
-    public func videoPlay() {
-        if !_videoView.isHidden {
-            _videoView.play()
-        }
-    }
-    public func videoPause() {
-        if !_videoView.isHidden || _videoView.isPlaying {
-            _videoView.pause()
-        }
-    }
-}
-

+ 0 - 203
RainbowPlanet/RainbowPlanet/Modules/PublishModule/PhotoPicker/TLPhotoPicker/TLPhotoCollectionViewCell.swift

@@ -1,203 +0,0 @@
-//
-//  TLPhotoCollectionViewCell.swift
-//  TLPhotosPicker
-//
-//  Created by wade.hawk on 2017. 5. 3..
-//  Copyright © 2017년 wade.hawk. All rights reserved.
-//
-
-import UIKit
-import PhotosUI
-
-open class TLPlayerView: UIView {
-    @objc open var player: AVPlayer? {
-        get {
-            return playerLayer.player
-        }
-        set {
-            playerLayer.player = newValue
-        }
-    }
-    
-    @objc open var playerLayer: AVPlayerLayer {
-        return layer as! AVPlayerLayer
-    }
-    
-    // Override UIView property
-    override open class var layerClass: AnyClass {
-        return AVPlayerLayer.self
-    }
-}
-
-open class TLPhotoCollectionViewCell: UICollectionViewCell {
-    private var observer: NSObjectProtocol?
-    @IBOutlet open var imageView: UIImageView?
-    @IBOutlet open var playerView: TLPlayerView?
-    @IBOutlet open var livePhotoView: PHLivePhotoView?
-    @IBOutlet open var liveBadgeImageView: UIImageView?
-    @IBOutlet open var durationView: UIView?
-    @IBOutlet open var videoIconImageView: UIImageView?
-    @IBOutlet open var durationLabel: UILabel?
-    @IBOutlet open var indicator: UIActivityIndicatorView?
-    @IBOutlet open var selectedView: UIView?
-    @IBOutlet open var noSelectedView: UIView?
-    @IBOutlet open var orderLabel: UILabel?
-    @IBOutlet open var orderBgView: UIView?
-
-    
-    var configure = TLPhotosPickerConfigure() {
-        didSet {
-            self.selectedView?.layer.borderColor = self.configure.selectedColor.cgColor
-            self.videoIconImageView?.image = self.configure.videoIcon
-        }
-    }
-    
-    @objc open var isCameraCell = false
-    
-    open var duration: TimeInterval? {
-        didSet {
-            guard let duration = self.duration else { return }
-//            self.selectedHeight?.constant = -10
-            self.durationLabel?.text = timeFormatted(timeInterval: duration)
-        }
-    }
-    
-    @objc open var player: AVPlayer? = nil {
-        didSet {
-            if self.configure.autoPlay == false { return }
-            if self.player == nil {
-                self.playerView?.playerLayer.player = nil
-                if let observer = self.observer {
-                    NotificationCenter.default.removeObserver(observer)
-                }
-            }else {
-                self.playerView?.playerLayer.player = self.player
-                self.observer = NotificationCenter.default.addObserver(forName: .AVPlayerItemDidPlayToEndTime, object: self.player?.currentItem, queue: nil, using: { [weak self] (_) in
-                    DispatchQueue.main.async {
-                        guard let `self` = self else { return }
-                        self.player?.seek(to: CMTime.zero)
-                        self.player?.play()
-                        self.player?.isMuted = self.configure.muteAudio
-                    }
-                })
-            }
-        }
-    }
-    
-    @objc open var selectedAsset: Bool = false {
-        willSet(newValue) {
-            self.selectedView?.isHidden = !newValue
-            if !newValue {
-                self.orderLabel?.text = ""
-            }else {
-                self.orderLabel?.isHidden = false
-            }
-        }
-    }
-    
-    
-    /// 转换时长
-    ///
-    /// - Parameter timeInterval: 时长
-    /// - Returns: 时长字符串
-    @objc open func timeFormatted(timeInterval: TimeInterval) -> String {
-        let seconds: Int = lround(timeInterval)
-        var hour: Int = 0
-        var minute: Int = Int(seconds/60)
-        let second: Int = seconds % 60
-        
-        if minute > 59 {
-            hour = minute / 60
-            minute = minute % 60
-            return String(format: "%d:%d:%02d", hour, minute, second)
-        } else {
-            return String(format: "%d:%02d", minute, second)
-        }
-        
-        
-    }
-    
-    @objc open func popScaleAnim() {
-        UIView.animate(withDuration: 0.1, animations: {
-            self.transform = CGAffineTransform(scaleX: 1.05, y: 1.05)
-        }) { _ in
-            UIView.animate(withDuration: 0.1, animations: {
-                self.transform = CGAffineTransform(scaleX: 1, y: 1)
-            })
-        }
-    }
-    
-    @objc open func update(with phAsset: PHAsset) {
-        
-    }
-    
-    @objc open func selectedCell() {
-        
-    }
-    
-    @objc open func willDisplayCell() {
-        
-    }
-    
-    @objc open func endDisplayingCell() {
-        
-    }
-    
-    @objc func stopPlay() {
-        if let player = self.player {
-            player.pause()
-            self.player = nil
-        }
-        self.livePhotoView?.isHidden = true
-        self.livePhotoView?.stopPlayback()
-        self.livePhotoView?.delegate = nil
-    }
-    
-    deinit {
-        NXLLog("deinit")
-    }
-    
-    override open func awakeFromNib() {
-        super.awakeFromNib()
-        self.playerView?.playerLayer.videoGravity = AVLayerVideoGravity.resizeAspectFill
-        self.livePhotoView?.isHidden = true
-        self.durationView?.isHidden = true
-        self.durationView?.backgroundColor = UIColor.clear
-        self.selectedView?.isHidden = true
-        self.selectedView?.layer.borderWidth = 1.5
-        self.selectedView?.backgroundColor = kThemeColor.withAlphaComponent(0.2)
-
-        self.videoIconImageView?.isHidden = true
-        self.orderBgView?.layer.borderWidth = 1.5
-        self.orderBgView?.layer.cornerRadius = self.orderBgView!.width/2
-        self.orderBgView?.layer.borderColor = kffffffColor.cgColor
-        self.orderBgView?.backgroundColor = UIColor.init(hexString: "000000", alpha: 0.2)
-        self.orderLabel?.isHidden = true
-        self.videoIconImageView?.image = self.configure.videoIcon
-        if #available(iOS 11.0, *) {
-            self.imageView?.accessibilityIgnoresInvertColors = true
-            self.playerView?.accessibilityIgnoresInvertColors = true
-            self.livePhotoView?.accessibilityIgnoresInvertColors = true
-            self.videoIconImageView?.accessibilityIgnoresInvertColors = true
-        }
-    }
-    
-    override open func prepareForReuse() {
-        super.prepareForReuse()
-        stopPlay()
-        self.livePhotoView?.isHidden = true
-        self.livePhotoView?.delegate = nil
-        self.durationView?.isHidden = true
-        self.durationView?.backgroundColor = UIColor.clear
-        self.videoIconImageView?.isHidden = true
-        self.selectedAsset = false
-    }
-    
-
-    open override var isSelected: Bool {
-        didSet {
-            self.selectedView?.isHidden = !self.isSelected
-        }
-    }
-    
-}

+ 0 - 274
RainbowPlanet/RainbowPlanet/Modules/PublishModule/PhotoPicker/TLPhotoPicker/TLPhotoLibrary.swift

@@ -1,274 +0,0 @@
-//
-//  TLPhotoLibrary.swift
-//  TLPhotosPicker
-//
-//  Created by wade.hawk on 2017. 5. 3..
-//  Copyright © 2017년 wade.hawk. All rights reserved.
-//
-
-import Foundation
-import Photos
-
-protocol TLPhotoLibraryDelegate: class {
-    func loadCameraRollCollection(collection: TLAssetsCollection)
-    func loadCompleteAllCollection(collections: [TLAssetsCollection])
-}
-
-class TLPhotoLibrary {
-    
-    weak var delegate: TLPhotoLibraryDelegate? = nil
-    
-    lazy var imageManager: PHCachingImageManager = {
-        return PHCachingImageManager()
-    }()
-    
-    deinit {
-        //        print("deinit TLPhotoLibrary")
-    }
-    
-    @discardableResult
-    func livePhotoAsset(asset: PHAsset, size: CGSize = CGSize(width: 720, height: 1280), progressBlock: Photos.PHAssetImageProgressHandler? = nil, completionBlock:@escaping (PHLivePhoto,Bool)-> Void ) -> PHImageRequestID {
-        let options = PHLivePhotoRequestOptions()
-        options.deliveryMode = .opportunistic
-        options.isNetworkAccessAllowed = true
-        options.progressHandler = progressBlock
-        let scale = min(UIScreen.main.scale,2)
-        let targetSize = CGSize(width: size.width*scale, height: size.height*scale)
-        let requestID = self.imageManager.requestLivePhoto(for: asset, targetSize: targetSize, contentMode: .aspectFill, options: options) { (livePhoto, info) in
-            let complete = (info?["PHImageResultIsDegradedKey"] as? Bool) == false
-            if let livePhoto = livePhoto {
-                completionBlock(livePhoto,complete)
-            }
-        }
-        return requestID
-    }
-    
-    @discardableResult
-    func videoAsset(asset: PHAsset, size: CGSize = CGSize(width: 720, height: 1280), progressBlock: Photos.PHAssetImageProgressHandler? = nil, completionBlock:@escaping (AVPlayerItem?, [AnyHashable : Any]?) -> Void ) -> PHImageRequestID {
-        let options = PHVideoRequestOptions()
-        options.isNetworkAccessAllowed = true
-        options.deliveryMode = .automatic
-        options.progressHandler = progressBlock
-        let requestID = self.imageManager.requestPlayerItem(forVideo: asset, options: options, resultHandler: { playerItem, info in
-            completionBlock(playerItem,info)
-        })
-        return requestID
-    }
-    
-    @discardableResult
-    func imageAsset(asset: PHAsset, size: CGSize = CGSize(width: 160, height: 160), options: PHImageRequestOptions? = nil, completionBlock:@escaping (UIImage,Bool)-> Void ) -> PHImageRequestID {
-        var options = options
-        if options == nil {
-            options = PHImageRequestOptions()
-            options?.isSynchronous = false
-            options?.resizeMode = .exact
-            options?.deliveryMode = .opportunistic
-            options?.isNetworkAccessAllowed = true
-        }
-        let scale = min(UIScreen.main.scale,2)
-        let targetSize = CGSize(width: size.width*scale, height: size.height*scale)
-        let requestID = self.imageManager.requestImage(for: asset, targetSize: targetSize, contentMode: .aspectFill, options: options) { image, info in
-            let complete = (info?["PHImageResultIsDegradedKey"] as? Bool) == false
-            if let image = image {
-                completionBlock(image,complete)
-            }
-        }
-        return requestID
-    }
-    
-    func cancelPHImageRequest(requestID: PHImageRequestID) {
-        self.imageManager.cancelImageRequest(requestID)
-    }
-    
-    @discardableResult
-    class func cloudImageDownload(asset: PHAsset, size: CGSize = PHImageManagerMaximumSize, progressBlock: @escaping (Double) -> Void, completionBlock:@escaping (UIImage?)-> Void ) -> PHImageRequestID {
-        let options = PHImageRequestOptions()
-        options.isSynchronous = false
-        options.isNetworkAccessAllowed = true
-        options.deliveryMode = .opportunistic
-        options.version = .current
-        options.resizeMode = .exact
-        options.progressHandler = { (progress,error,stop,info) in
-            progressBlock(progress)
-        }
-        let requestID = PHCachingImageManager().requestImageData(for: asset, options: options) { (imageData, dataUTI, orientation, info) in
-            if let data = imageData,let _ = info {
-                completionBlock(UIImage(data: data))
-            }else{
-                completionBlock(nil)//error
-            }
-        }
-        return requestID
-    }
-    
-    @discardableResult
-    class func fullResolutionImageData(asset: PHAsset) -> UIImage? {
-        let options = PHImageRequestOptions()
-        options.isSynchronous = true
-        options.resizeMode = .none
-        options.isNetworkAccessAllowed = false
-        options.version = .current
-        var image: UIImage? = nil
-        _ = PHCachingImageManager().requestImageData(for: asset, options: options) { (imageData, dataUTI, orientation, info) in
-            if let data = imageData {
-                image = UIImage(data: data)
-            }
-        }
-        return image
-    }
-}
-
-extension PHFetchOptions {
-    func merge(predicate: NSPredicate) {
-        if let storePredicate = self.predicate {
-            self.predicate = NSCompoundPredicate(andPredicateWithSubpredicates: [storePredicate, predicate])
-        }else {
-            self.predicate = predicate
-        }
-    }
-}
-
-//MARK: - Load Collection
-extension TLPhotoLibrary {
-    func getOption(configure: TLPhotosPickerConfigure) -> PHFetchOptions {
-        
-        let options = configure.fetchOption ?? PHFetchOptions()
-        options.sortDescriptors = [NSSortDescriptor(key: "creationDate", ascending: false)]
-        if let mediaType = configure.mediaType {
-            let mediaPredicate = NSPredicate(format: "mediaType = %i", mediaType.rawValue)
-            options.merge(predicate: mediaPredicate)
-        }
-        if configure.allowedVideo == false {
-            let notVideoPredicate = NSPredicate(format: "mediaType != %i", PHAssetMediaType.video.rawValue)
-            options.merge(predicate: notVideoPredicate)
-        }
-        if configure.allowedLivePhotos == false {
-            let notLivePhotoPredicate = NSPredicate(format: "NOT ((mediaSubtype & %d) != 0)", PHAssetMediaSubtype.photoLive.rawValue)
-            options.merge(predicate: notLivePhotoPredicate)
-        }
-        if let maxVideoDuration = configure.maxVideoDuration {
-            let durationPredicate = NSPredicate(format: "duration < %f", maxVideoDuration)
-            options.merge(predicate: durationPredicate)
-        }
-        return options
-    }
-    
-    func fetchResult(collection: TLAssetsCollection?, configure: TLPhotosPickerConfigure) -> PHFetchResult<PHAsset>? {
-        guard let phAssetCollection = collection?.phAssetCollection else { return nil }
-        let options = getOption(configure: configure)
-        return PHAsset.fetchAssets(in: phAssetCollection, options: options)
-    }
-    
-    func fetchCollection(configure: TLPhotosPickerConfigure) {
-        let useCameraButton = configure.usedCameraButton
-        let options = getOption(configure: configure)
-        let fetchCollectionOption = configure.fetchCollectionOption
-        
-        func getAlbum(subType: PHAssetCollectionSubtype, result: inout [TLAssetsCollection]) {
-            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.allowedAlbumCloudShared == false && collection.assetCollectionSubtype == .albumCloudShared {
-                }else {
-                    collections.append(collection)
-                }
-            }
-            for collection in collections {
-                if !result.contains(where: { $0.localIdentifier == collection.localIdentifier }) {
-                    var assetsCollection = TLAssetsCollection(collection: collection)
-                    assetsCollection.fetchResult = PHAsset.fetchAssets(in: collection, options: options)
-                    if assetsCollection.count > 0 {
-                        result.append(assetsCollection)
-                    }
-                }
-            }
-        }
-        
-        @discardableResult
-        func getSmartAlbum(subType: PHAssetCollectionSubtype,
-                           useCameraButton: Bool = false,
-                           result: inout [TLAssetsCollection])
-            -> TLAssetsCollection?
-        {
-            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 = TLAssetsCollection(collection: collection)
-                assetsCollection.fetchResult = PHAsset.fetchAssets(in: collection, options: options)
-                if assetsCollection.count > 0 || useCameraButton {
-                    result.append(assetsCollection)
-                    return assetsCollection
-                }
-            }
-            return nil
-        }
-        if let fetchCollectionTypes = configure.fetchCollectionTypes {
-            DispatchQueue.global(qos: .userInteractive).async { [weak self] in
-                var assetCollections = [TLAssetsCollection]()
-                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 = [TLAssetsCollection]()
-                //Camera Roll
-                let camerarollCollection = getSmartAlbum(subType: .smartAlbumUserLibrary,
-                                                         useCameraButton: useCameraButton,
-                                                         result: &assetCollections)
-                if var cameraRoll = camerarollCollection {
-                    cameraRoll.useCameraButton = useCameraButton
-                    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.allowedVideo {
-                    //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 = TLAssetsCollection(collection: collection)
-                    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)
-                }
-            }
-        }
-    }
-}
-

+ 0 - 55
RainbowPlanet/RainbowPlanet/Modules/PublishModule/PhotoPicker/TLPhotoPicker/TLPhotopickerProtocol.swift

@@ -1,55 +0,0 @@
-//
-//  TLPhotopickerDataSourcesProtocol.swift
-//  TLPhotoPicker
-//
-//  Created by wade.hawk on 21/01/2019.
-//
-
-import Foundation
-import Photos
-
-protocol TLPhotopickerDataSourcesProtocol {
-    func headerReferenceSize() -> CGSize
-    func footerReferenceSize() -> CGSize
-    func registerSupplementView(collectionView: UICollectionView)
-    func supplementIdentifier(kind: String) -> String
-    func configure(supplement view: UICollectionReusableView, section: (title: String, assets: [TLPHAsset]))
-}
-
-protocol TLPhotosPickerViewControllerDelegate: class {
-    func dismissPhotoPicker(withPHAssets: [PHAsset])
-    func dismissPhotoPicker(withTLPHAssets: [TLPHAsset])
-    func dismissComplete()
-    func photoPickerDidCancel()
-    func canSelectAsset(phAsset: PHAsset) -> Bool
-    func didExceedMaximumNumberOfSelection(picker: TLPhotosPickerViewController)
-    func handleNoAlbumPermissions(picker: TLPhotosPickerViewController)
-    func handleNoCameraPermissions(picker: TLPhotosPickerViewController)
-}
-
-extension TLPhotosPickerViewControllerDelegate {
-    public func deninedAuthoization() { }
-    public func dismissPhotoPicker(withPHAssets: [PHAsset]) { }
-    public func dismissPhotoPicker(withTLPHAssets: [TLPHAsset]) { }
-    public func dismissComplete() { }
-    public func photoPickerDidCancel() { }
-    public func canSelectAsset(phAsset: PHAsset) -> Bool { return true }
-    public func didExceedMaximumNumberOfSelection(picker: TLPhotosPickerViewController) { }
-    public func handleNoAlbumPermissions(picker: TLPhotosPickerViewController) { }
-    public func handleNoCameraPermissions(picker: TLPhotosPickerViewController) { }
-}
-
-//for log
-protocol TLPhotosPickerLogDelegate: class {
-    func selectedCameraCell(picker: TLPhotosPickerViewController)
-    func deselectedPhoto(picker: TLPhotosPickerViewController, at: Int)
-    func selectedPhoto(picker: TLPhotosPickerViewController, at: Int)
-    func selectedAlbum(picker: TLPhotosPickerViewController, title: String, at: Int)
-}
-
-extension TLPhotosPickerLogDelegate {
-    func selectedCameraCell(picker: TLPhotosPickerViewController) { }
-    func deselectedPhoto(picker: TLPhotosPickerViewController, at: Int) { }
-    func selectedPhoto(picker: TLPhotosPickerViewController, at: Int) { }
-    func selectedAlbum(picker: TLPhotosPickerViewController, collections: [TLAssetsCollection], at: Int) { }
-}

Dosya farkı çok büyük olduğundan ihmal edildi
+ 0 - 1018
RainbowPlanet/RainbowPlanet/Modules/PublishModule/PhotoPicker/TLPhotoPicker/TLPhotosPickerViewController.swift


+ 0 - 53
RainbowPlanet/RainbowPlanet/Modules/PublishModule/PhotoPicker/TLPhotoPickerResources/CustomCameraCell.xib

@@ -1,53 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="13196" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
-    <device id="retina4_7" orientation="portrait">
-        <adaptation id="fullscreen"/>
-    </device>
-    <dependencies>
-        <deployment identifier="iOS"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13174"/>
-        <capability name="Safe area layout guides" minToolsVersion="9.0"/>
-        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
-    </dependencies>
-    <objects>
-        <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
-        <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
-        <collectionViewCell opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" reuseIdentifier="CustomCameraCell" id="yXg-PX-cBI" userLabel="CustomCameraCell" customClass="CustomCameraCell" customModule="TLPhotoPicker_Example" customModuleProvider="target">
-            <rect key="frame" x="0.0" y="0.0" width="100" height="100"/>
-            <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
-            <view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
-                <rect key="frame" x="0.0" y="0.0" width="100" height="100"/>
-                <autoresizingMask key="autoresizingMask"/>
-                <subviews>
-                    <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="OEa-vx-nyF" customClass="PreviewView" customModule="TLPhotoPicker_Example" customModuleProvider="target">
-                        <rect key="frame" x="0.0" y="0.0" width="100" height="100"/>
-                        <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
-                    </view>
-                    <imageView userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="100" translatesAutoresizingMaskIntoConstraints="NO" id="IbX-QH-EmX">
-                        <rect key="frame" x="24.5" y="37" width="50" height="25"/>
-                        <constraints>
-                            <constraint firstAttribute="width" constant="50" id="WeH-wk-mnf"/>
-                            <constraint firstAttribute="height" constant="25" id="fg0-xR-Kit"/>
-                        </constraints>
-                    </imageView>
-                </subviews>
-            </view>
-            <constraints>
-                <constraint firstAttribute="trailing" secondItem="OEa-vx-nyF" secondAttribute="trailing" id="1q8-NV-mi4"/>
-                <constraint firstAttribute="bottom" secondItem="OEa-vx-nyF" secondAttribute="bottom" id="8M9-xE-Sfw"/>
-                <constraint firstItem="IbX-QH-EmX" firstAttribute="centerX" secondItem="sl5-A7-gYS" secondAttribute="centerX" id="PGI-5k-d7B"/>
-                <constraint firstItem="OEa-vx-nyF" firstAttribute="top" secondItem="yXg-PX-cBI" secondAttribute="top" id="TFO-Hn-Zvg"/>
-                <constraint firstItem="OEa-vx-nyF" firstAttribute="leading" secondItem="yXg-PX-cBI" secondAttribute="leading" id="aPC-Pg-0LQ"/>
-                <constraint firstItem="IbX-QH-EmX" firstAttribute="centerY" secondItem="sl5-A7-gYS" secondAttribute="centerY" id="bQT-vE-AZ8"/>
-            </constraints>
-            <viewLayoutGuide key="safeArea" id="sl5-A7-gYS"/>
-            <connections>
-                <outlet property="previewView" destination="OEa-vx-nyF" id="egv-bz-BnD"/>
-            </connections>
-            <point key="canvasLocation" x="32" y="-10"/>
-        </collectionViewCell>
-    </objects>
-    <resources>
-        <image name="100" width="50" height="50"/>
-    </resources>
-</document>

+ 0 - 58
RainbowPlanet/RainbowPlanet/Modules/PublishModule/PhotoPicker/TLPhotoPickerResources/TLCollectionTableViewCell.xib

@@ -1,58 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="12120" systemVersion="16E195" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
-    <device id="retina4_7" orientation="portrait">
-        <adaptation id="fullscreen"/>
-    </device>
-    <dependencies>
-        <deployment identifier="iOS"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12088"/>
-        <capability name="Constraints to layout margins" minToolsVersion="6.0"/>
-        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
-    </dependencies>
-    <objects>
-        <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
-        <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
-        <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="TLCollectionTableViewCell" id="9FY-S1-KKQ" customClass="TLCollectionTableViewCell" customModule="TLPhotoPicker" customModuleProvider="target">
-            <rect key="frame" x="0.0" y="0.0" width="375" height="75"/>
-            <autoresizingMask key="autoresizingMask"/>
-            <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="9FY-S1-KKQ" id="UUZ-nI-xH1">
-                <rect key="frame" x="0.0" y="0.0" width="375" height="74.5"/>
-                <autoresizingMask key="autoresizingMask"/>
-                <subviews>
-                    <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="4Dk-kD-sMy">
-                        <rect key="frame" x="5" y="12.5" width="50" height="50"/>
-                        <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
-                    </imageView>
-                    <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="5" translatesAutoresizingMaskIntoConstraints="NO" id="7nv-2U-xMp">
-                        <rect key="frame" x="69" y="19" width="248" height="36.5"/>
-                        <subviews>
-                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Camera Roll" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ES8-Tq-6Wz">
-                                <rect key="frame" x="0.0" y="0.0" width="248" height="17"/>
-                                <fontDescription key="fontDescription" type="system" weight="semibold" pointSize="14"/>
-                                <nil key="textColor"/>
-                                <nil key="highlightedColor"/>
-                            </label>
-                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="9999" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="NuJ-3w-ZAP">
-                                <rect key="frame" x="0.0" y="22" width="248" height="14.5"/>
-                                <fontDescription key="fontDescription" type="system" pointSize="12"/>
-                                <color key="textColor" red="0.43137254901960786" green="0.43137254901960786" blue="0.43137254901960786" alpha="1" colorSpace="calibratedRGB"/>
-                                <nil key="highlightedColor"/>
-                            </label>
-                        </subviews>
-                    </stackView>
-                </subviews>
-                <constraints>
-                    <constraint firstItem="7nv-2U-xMp" firstAttribute="centerY" secondItem="UUZ-nI-xH1" secondAttribute="centerY" id="E6U-ch-GDV"/>
-                    <constraint firstItem="7nv-2U-xMp" firstAttribute="leading" secondItem="UUZ-nI-xH1" secondAttribute="leadingMargin" constant="61" id="Jsu-Hd-Sg3"/>
-                    <constraint firstAttribute="trailingMargin" secondItem="7nv-2U-xMp" secondAttribute="trailing" constant="50" id="T3U-hj-718"/>
-                </constraints>
-            </tableViewCellContentView>
-            <connections>
-                <outlet property="subTitleLabel" destination="NuJ-3w-ZAP" id="vlD-VJ-e5z"/>
-                <outlet property="thumbImageView" destination="4Dk-kD-sMy" id="f8b-VP-j8s"/>
-                <outlet property="titleLabel" destination="ES8-Tq-6Wz" id="sYW-0b-o03"/>
-            </connections>
-            <point key="canvasLocation" x="9.5" y="-83"/>
-        </tableViewCell>
-    </objects>
-</document>

+ 0 - 150
RainbowPlanet/RainbowPlanet/Modules/PublishModule/PhotoPicker/TLPhotoPickerResources/TLPhotoCollectionViewCell.xib

@@ -1,150 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14490.70" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
-    <device id="retina4_7" orientation="portrait">
-        <adaptation id="fullscreen"/>
-    </device>
-    <dependencies>
-        <deployment identifier="iOS"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14490.49"/>
-        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
-    </dependencies>
-    <objects>
-        <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
-        <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
-        <collectionViewCell opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" reuseIdentifier="TLPhotoCollectionViewCell" id="IF3-4e-v0j" customClass="TLPhotoCollectionViewCell" customModule="RainbowPlanet" customModuleProvider="target">
-            <rect key="frame" x="0.0" y="0.0" width="100" height="100"/>
-            <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
-            <view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
-                <rect key="frame" x="0.0" y="0.0" width="100" height="100"/>
-                <autoresizingMask key="autoresizingMask"/>
-                <subviews>
-                    <imageView userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="0cR-fZ-1bW">
-                        <rect key="frame" x="0.0" y="0.0" width="100" height="100"/>
-                    </imageView>
-                    <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="vfk-Ao-TKR" customClass="PHLivePhotoView">
-                        <rect key="frame" x="0.0" y="0.0" width="100" height="100"/>
-                        <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
-                    </view>
-                    <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="TGh-wt-hcR">
-                        <rect key="frame" x="70" y="70" width="25" height="25"/>
-                        <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
-                        <constraints>
-                            <constraint firstAttribute="width" constant="25" id="NMA-SI-Idt"/>
-                            <constraint firstAttribute="height" constant="25" id="XvY-Ee-EA2"/>
-                        </constraints>
-                    </imageView>
-                    <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="apl-2Q-Hz7" customClass="TLPlayerView" customModule="RainbowPlanet" customModuleProvider="target">
-                        <rect key="frame" x="0.0" y="0.0" width="100" height="100"/>
-                        <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
-                    </view>
-                    <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="hbA-dR-I09">
-                        <rect key="frame" x="72" y="6" width="22" height="22"/>
-                        <subviews>
-                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="1" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Weu-ef-IZ5">
-                                <rect key="frame" x="0.0" y="0.0" width="22" height="22"/>
-                                <constraints>
-                                    <constraint firstAttribute="width" constant="22" id="YMX-0Z-bfm"/>
-                                </constraints>
-                                <fontDescription key="fontDescription" type="system" weight="semibold" pointSize="13"/>
-                                <color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
-                                <nil key="highlightedColor"/>
-                            </label>
-                        </subviews>
-                        <color key="backgroundColor" red="0.27843137254901962" green="0.47058823529411764" blue="0.85098039215686272" alpha="1" colorSpace="calibratedRGB"/>
-                        <constraints>
-                            <constraint firstAttribute="bottom" secondItem="Weu-ef-IZ5" secondAttribute="bottom" id="7bq-sF-B2u"/>
-                            <constraint firstAttribute="width" constant="22" id="Hod-zO-nZN"/>
-                            <constraint firstAttribute="trailing" secondItem="Weu-ef-IZ5" secondAttribute="trailing" id="KAX-uN-lIv"/>
-                            <constraint firstAttribute="height" constant="22" id="QIN-2H-KTL"/>
-                            <constraint firstItem="Weu-ef-IZ5" firstAttribute="top" secondItem="hbA-dR-I09" secondAttribute="top" id="Yiz-Jt-Vx2"/>
-                            <constraint firstItem="Weu-ef-IZ5" firstAttribute="leading" secondItem="hbA-dR-I09" secondAttribute="leading" id="sXm-jF-nJk"/>
-                        </constraints>
-                    </view>
-                    <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="d1a-KW-Ta4">
-                        <rect key="frame" x="0.0" y="0.0" width="100" height="100"/>
-                        <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
-                    </view>
-                    <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="aju-ob-KlZ">
-                        <rect key="frame" x="0.0" y="75" width="100" height="25"/>
-                        <subviews>
-                            <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Uzf-HJ-aUY">
-                                <rect key="frame" x="5" y="2.5" width="20" height="20"/>
-                                <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
-                                <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
-                            </imageView>
-                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="0:02" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="zNx-FC-5V2">
-                                <rect key="frame" x="30" y="0.0" width="65" height="25"/>
-                                <constraints>
-                                    <constraint firstAttribute="width" constant="65" id="3hi-82-ovQ"/>
-                                </constraints>
-                                <fontDescription key="fontDescription" type="system" pointSize="12"/>
-                                <color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
-                                <nil key="highlightedColor"/>
-                            </label>
-                        </subviews>
-                        <color key="backgroundColor" red="0.11109734326601028" green="0.57953345775604248" blue="0.96568840742111206" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
-                        <constraints>
-                            <constraint firstAttribute="height" constant="25" id="DzP-0j-1SD"/>
-                            <constraint firstItem="zNx-FC-5V2" firstAttribute="top" secondItem="aju-ob-KlZ" secondAttribute="top" id="Lim-xf-cbx"/>
-                            <constraint firstAttribute="bottom" secondItem="zNx-FC-5V2" secondAttribute="bottom" id="T0P-EH-uPu"/>
-                            <constraint firstAttribute="trailing" secondItem="zNx-FC-5V2" secondAttribute="trailing" constant="5" id="uhl-Y8-3g5"/>
-                        </constraints>
-                    </view>
-                    <view hidden="YES" userInteractionEnabled="NO" alpha="0.69999999999999996" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="FEL-h5-jvm">
-                        <rect key="frame" x="0.0" y="0.0" width="100" height="100"/>
-                        <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
-                    </view>
-                    <activityIndicatorView hidden="YES" opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" hidesWhenStopped="YES" style="gray" translatesAutoresizingMaskIntoConstraints="NO" id="DZc-ag-e55">
-                        <rect key="frame" x="40" y="40" width="20" height="20"/>
-                    </activityIndicatorView>
-                </subviews>
-            </view>
-            <constraints>
-                <constraint firstAttribute="bottom" secondItem="vfk-Ao-TKR" secondAttribute="bottom" id="2gw-cO-5bN"/>
-                <constraint firstAttribute="bottom" secondItem="aju-ob-KlZ" secondAttribute="bottom" id="2wo-Ki-15d"/>
-                <constraint firstAttribute="trailing" secondItem="aju-ob-KlZ" secondAttribute="trailing" id="2zm-kD-GPn"/>
-                <constraint firstAttribute="bottom" secondItem="apl-2Q-Hz7" secondAttribute="bottom" id="3zu-V3-EAd"/>
-                <constraint firstAttribute="trailing" secondItem="0cR-fZ-1bW" secondAttribute="trailing" id="9sd-Ea-EBO"/>
-                <constraint firstAttribute="trailing" secondItem="vfk-Ao-TKR" secondAttribute="trailing" id="BZ0-ZG-uW5"/>
-                <constraint firstAttribute="bottom" secondItem="TGh-wt-hcR" secondAttribute="bottom" constant="5" id="Ba1-Z6-ypz"/>
-                <constraint firstAttribute="trailing" secondItem="hbA-dR-I09" secondAttribute="trailing" constant="6" id="CKZ-Dp-2w9"/>
-                <constraint firstItem="0cR-fZ-1bW" firstAttribute="leading" secondItem="IF3-4e-v0j" secondAttribute="leading" id="DXe-M9-mxX"/>
-                <constraint firstItem="aju-ob-KlZ" firstAttribute="leading" secondItem="IF3-4e-v0j" secondAttribute="leading" id="FDl-UE-XVM"/>
-                <constraint firstItem="apl-2Q-Hz7" firstAttribute="top" secondItem="IF3-4e-v0j" secondAttribute="top" id="JlA-ya-cf3"/>
-                <constraint firstAttribute="trailing" secondItem="apl-2Q-Hz7" secondAttribute="trailing" id="KZg-oh-B11"/>
-                <constraint firstAttribute="trailing" secondItem="TGh-wt-hcR" secondAttribute="trailing" constant="5" id="Meo-q5-HyZ"/>
-                <constraint firstItem="vfk-Ao-TKR" firstAttribute="leading" secondItem="IF3-4e-v0j" secondAttribute="leading" id="NOQ-KU-fHD"/>
-                <constraint firstItem="vfk-Ao-TKR" firstAttribute="top" secondItem="IF3-4e-v0j" secondAttribute="top" id="NrV-wc-c3q"/>
-                <constraint firstAttribute="bottom" secondItem="FEL-h5-jvm" secondAttribute="bottom" id="OHo-QO-DqX"/>
-                <constraint firstItem="FEL-h5-jvm" firstAttribute="top" secondItem="IF3-4e-v0j" secondAttribute="top" id="UZE-HD-qV4"/>
-                <constraint firstItem="d1a-KW-Ta4" firstAttribute="height" secondItem="IF3-4e-v0j" secondAttribute="height" id="VMJ-Qp-D4N"/>
-                <constraint firstItem="apl-2Q-Hz7" firstAttribute="leading" secondItem="IF3-4e-v0j" secondAttribute="leading" id="bsL-0J-0Y5"/>
-                <constraint firstItem="d1a-KW-Ta4" firstAttribute="width" secondItem="IF3-4e-v0j" secondAttribute="width" id="clS-DI-jvL"/>
-                <constraint firstItem="hbA-dR-I09" firstAttribute="top" secondItem="IF3-4e-v0j" secondAttribute="top" constant="6" id="cox-pe-Udx"/>
-                <constraint firstItem="d1a-KW-Ta4" firstAttribute="top" secondItem="IF3-4e-v0j" secondAttribute="top" id="d3r-HZ-6We"/>
-                <constraint firstItem="DZc-ag-e55" firstAttribute="centerX" secondItem="IF3-4e-v0j" secondAttribute="centerX" id="fnn-1c-fSn"/>
-                <constraint firstAttribute="trailing" secondItem="FEL-h5-jvm" secondAttribute="trailing" id="jTi-pR-jF5"/>
-                <constraint firstItem="DZc-ag-e55" firstAttribute="centerY" secondItem="IF3-4e-v0j" secondAttribute="centerY" id="qZc-2h-nOx"/>
-                <constraint firstItem="d1a-KW-Ta4" firstAttribute="leading" secondItem="IF3-4e-v0j" secondAttribute="leading" id="sOj-ms-Oo3"/>
-                <constraint firstItem="0cR-fZ-1bW" firstAttribute="top" secondItem="IF3-4e-v0j" secondAttribute="top" id="sSC-fd-MoT"/>
-                <constraint firstItem="FEL-h5-jvm" firstAttribute="leading" secondItem="IF3-4e-v0j" secondAttribute="leading" id="sYJ-Ey-xX3"/>
-                <constraint firstAttribute="bottom" secondItem="0cR-fZ-1bW" secondAttribute="bottom" id="xzA-tS-EVK"/>
-            </constraints>
-            <connections>
-                <outlet property="durationLabel" destination="zNx-FC-5V2" id="5SU-lD-AGm"/>
-                <outlet property="durationView" destination="aju-ob-KlZ" id="hiP-Ze-cbc"/>
-                <outlet property="imageView" destination="0cR-fZ-1bW" id="N3f-v5-K9b"/>
-                <outlet property="indicator" destination="DZc-ag-e55" id="R3y-XL-0SY"/>
-                <outlet property="liveBadgeImageView" destination="TGh-wt-hcR" id="cry-3P-rLI"/>
-                <outlet property="livePhotoView" destination="vfk-Ao-TKR" id="uvj-l1-wcp"/>
-                <outlet property="noSelectedView" destination="FEL-h5-jvm" id="tdZ-CE-7W2"/>
-                <outlet property="orderBgView" destination="hbA-dR-I09" id="cQo-BP-xh1"/>
-                <outlet property="orderLabel" destination="Weu-ef-IZ5" id="B3t-X5-o3a"/>
-                <outlet property="playerView" destination="apl-2Q-Hz7" id="vTI-ie-mcV"/>
-                <outlet property="selectedView" destination="d1a-KW-Ta4" id="c31-4y-72g"/>
-                <outlet property="videoIconImageView" destination="Uzf-HJ-aUY" id="d7e-Bl-181"/>
-            </connections>
-            <point key="canvasLocation" x="32" y="-10.794602698650676"/>
-        </collectionViewCell>
-    </objects>
-</document>

BIN
RainbowPlanet/RainbowPlanet/Modules/PublishModule/PhotoPicker/TLPhotoPickerResources/TLPhotoPickerController.bundle/arrow.png


BIN
RainbowPlanet/RainbowPlanet/Modules/PublishModule/PhotoPicker/TLPhotoPickerResources/TLPhotoPickerController.bundle/camera@3x.png


BIN
RainbowPlanet/RainbowPlanet/Modules/PublishModule/PhotoPicker/TLPhotoPickerResources/TLPhotoPickerController.bundle/insertPhotoMaterial@3x.png


BIN
RainbowPlanet/RainbowPlanet/Modules/PublishModule/PhotoPicker/TLPhotoPickerResources/TLPhotoPickerController.bundle/pop_arrow.png


BIN
RainbowPlanet/RainbowPlanet/Modules/PublishModule/PhotoPicker/TLPhotoPickerResources/TLPhotoPickerController.bundle/video.png


+ 0 - 68
RainbowPlanet/RainbowPlanet/Modules/PublishModule/PhotoPicker/TLPhotoPickerResources/TLPhotosPickerViewController.xib

@@ -1,68 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14490.70" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
-    <device id="retina4_7" orientation="portrait">
-        <adaptation id="fullscreen"/>
-    </device>
-    <dependencies>
-        <deployment identifier="iOS"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14490.49"/>
-        <capability name="Safe area layout guides" minToolsVersion="9.0"/>
-        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
-    </dependencies>
-    <objects>
-        <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="TLPhotosPickerViewController" customModule="RainbowPlanet" customModuleProvider="target">
-            <connections>
-                <outlet property="collectionView" destination="4gR-Bn-quP" id="ZOF-qU-cpd"/>
-                <outlet property="collectionViewBottomConstrain" destination="qqE-w2-Tsc" id="FS3-hV-la8"/>
-                <outlet property="indicator" destination="AEv-G6-dRI" id="coA-3n-07e"/>
-                <outlet property="topViewTopBottomConstrain" destination="cal-KK-WHJ" id="XNx-1u-FWw"/>
-                <outlet property="view" destination="Zyk-dI-msE" id="dxK-gh-unF"/>
-            </connections>
-        </placeholder>
-        <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
-        <view contentMode="scaleToFill" id="Zyk-dI-msE">
-            <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
-            <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
-            <subviews>
-                <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="86M-sc-XP7">
-                    <rect key="frame" x="0.0" y="0.0" width="375" height="375"/>
-                    <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
-                    <constraints>
-                        <constraint firstAttribute="width" secondItem="86M-sc-XP7" secondAttribute="height" multiplier="1:1" id="Pwg-oc-6sf"/>
-                    </constraints>
-                </view>
-                <collectionView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" dataMode="prototypes" translatesAutoresizingMaskIntoConstraints="NO" id="4gR-Bn-quP">
-                    <rect key="frame" x="0.0" y="375" width="375" height="292"/>
-                    <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
-                    <collectionViewFlowLayout key="collectionViewLayout" minimumLineSpacing="1" minimumInteritemSpacing="1" id="VDa-Pp-VBq">
-                        <size key="itemSize" width="50" height="50"/>
-                        <size key="headerReferenceSize" width="0.0" height="0.0"/>
-                        <size key="footerReferenceSize" width="0.0" height="0.0"/>
-                        <inset key="sectionInset" minX="0.0" minY="0.0" maxX="0.0" maxY="0.0"/>
-                    </collectionViewFlowLayout>
-                    <connections>
-                        <outlet property="dataSource" destination="-1" id="6fE-SF-z6F"/>
-                        <outlet property="delegate" destination="-1" id="pjZ-sM-fyY"/>
-                    </connections>
-                </collectionView>
-                <activityIndicatorView hidden="YES" opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" hidesWhenStopped="YES" style="gray" translatesAutoresizingMaskIntoConstraints="NO" id="AEv-G6-dRI">
-                    <rect key="frame" x="177.5" y="323.5" width="20" height="20"/>
-                </activityIndicatorView>
-            </subviews>
-            <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
-            <constraints>
-                <constraint firstItem="AEv-G6-dRI" firstAttribute="centerX" secondItem="Zyk-dI-msE" secondAttribute="centerX" id="44C-fd-MVc"/>
-                <constraint firstItem="86M-sc-XP7" firstAttribute="leading" secondItem="HLR-WT-D3I" secondAttribute="leading" id="6om-vh-bwT"/>
-                <constraint firstItem="4gR-Bn-quP" firstAttribute="top" secondItem="86M-sc-XP7" secondAttribute="bottom" id="LPA-2k-jcU"/>
-                <constraint firstAttribute="trailing" secondItem="4gR-Bn-quP" secondAttribute="trailing" id="M6b-2G-2m1"/>
-                <constraint firstItem="AEv-G6-dRI" firstAttribute="centerY" secondItem="Zyk-dI-msE" secondAttribute="centerY" id="aLU-u9-ALA"/>
-                <constraint firstItem="86M-sc-XP7" firstAttribute="top" secondItem="Zyk-dI-msE" secondAttribute="top" id="cal-KK-WHJ"/>
-                <constraint firstItem="HLR-WT-D3I" firstAttribute="trailing" secondItem="86M-sc-XP7" secondAttribute="trailing" id="iA9-TJ-fym"/>
-                <constraint firstItem="4gR-Bn-quP" firstAttribute="leading" secondItem="Zyk-dI-msE" secondAttribute="leading" id="kb7-vy-yTu"/>
-                <constraint firstItem="4gR-Bn-quP" firstAttribute="bottom" secondItem="Zyk-dI-msE" secondAttribute="bottom" id="qqE-w2-Tsc"/>
-            </constraints>
-            <viewLayoutGuide key="safeArea" id="HLR-WT-D3I"/>
-            <point key="canvasLocation" x="32.799999999999997" y="52.623688155922046"/>
-        </view>
-    </objects>
-</document>

+ 6 - 2
RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishMediaPicker/Controller/KSMediaPickerController.swift

@@ -201,8 +201,12 @@ open class KSMediaPickerController: UIViewController, UICollectionViewDelegate,
             for (index, selItem) in _selectedAssetArray.enumerated() {
                 let itemModel = selItem as! KSMediaPickerItemModel
                 // 添加选中image
-                let image: UIImage = itemModel.original ?? UIImage()
-                imageArray.append(image)
+                let asset = itemModel.asset
+                let pixelWidth = CGFloat(asset.pixelWidth)
+                let pixelHeight = CGFloat(asset.pixelHeight)
+                PHImageManager.default().requestImage(for: asset, targetSize: CGSize(width: pixelWidth, height: pixelHeight), contentMode: .aspectFit, options: KSMediaPickerItemModel.pictureOptions) { (image, info) in
+                    imageArray.append(image!)
+                }
                 
                 if index == self._selectedAssetArray.count-1 {
                     

+ 4 - 4
RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishMediaPicker/KSExtension.swift

@@ -65,10 +65,10 @@ extension UIImage {
         let cgData = CGDataProvider(data: dataRef)!
         let cgImage = CGImage(jpegDataProviderSource: cgData, decode: nil, shouldInterpolate: true, intent: .defaultIntent)!
         let newCgImage = cgImage.cropping(to: rect)!
-//        let newImageData = CFDataCreateMutable(kCFAllocatorDefault, 0)!
-//        let destination = CGImageDestinationCreateWithData(newImageData, "public.jpeg" as CFString, 1, nil)!
-        let newImageData = NSMutableData()
-        let destination = CGImageDestinationCreateWithData(CFBridgingRetain(newImageData) as! CFMutableData, "public.jpeg" as CFString, 1, nil)!
+        let newImageData = CFDataCreateMutable(kCFAllocatorDefault, 0)!
+        let destination = CGImageDestinationCreateWithData(newImageData, "public.jpeg" as CFString, 1, nil)!
+//        let newImageData = NSMutableData()
+//        let destination = CGImageDestinationCreateWithData(CFBridgingRetain(newImageData) as! CFMutableData, "public.jpeg" as CFString, 1, nil)!
         let newImageInfoRef = CFDictionaryCreateMutableCopy(kCFAllocatorDefault, CFDictionaryGetCount(imageInfoRef), imageInfoRef)!
         CFDictionaryReplaceValue(newImageInfoRef, pixelHeightKey, Unmanaged.passRetained(NSNumber(value: Double(viewH))).autorelease().toOpaque())
         CFDictionaryReplaceValue(newImageInfoRef, pixelWidthKey, Unmanaged.passRetained(NSNumber(value: Double(viewW))).autorelease().toOpaque())

RainbowPlanet/RainbowPlanet/Modules/PublishModule/PhotoPicker/TLPhotoPicker/KSVideoPlayerView/KSVideoLayer.h → RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishMediaPicker/KSVideoPlayerView/KSVideoLayer.h


RainbowPlanet/RainbowPlanet/Modules/PublishModule/PhotoPicker/TLPhotoPicker/KSVideoPlayerView/KSVideoLayer.m → RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishMediaPicker/KSVideoPlayerView/KSVideoLayer.m


RainbowPlanet/RainbowPlanet/Modules/PublishModule/PhotoPicker/TLPhotoPicker/KSVideoPlayerView/KSVideoPlayerBaseView.h → RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishMediaPicker/KSVideoPlayerView/KSVideoPlayerBaseView.h


RainbowPlanet/RainbowPlanet/Modules/PublishModule/PhotoPicker/TLPhotoPicker/KSVideoPlayerView/KSVideoPlayerBaseView.m → RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishMediaPicker/KSVideoPlayerView/KSVideoPlayerBaseView.m


+ 4 - 3
RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishMediaPicker/Model/KSMediaPickerItemModel.swift

@@ -12,7 +12,7 @@ open class KSMediaPickerItemModel: NSObject {
     
     @objc public static let thumbSize = {() -> CGSize in
         let screen = UIScreen.main
-        let width = screen.bounds.size.width*screen.scale * 0.25
+        let width = screen.bounds.size.width*screen.scale * 0.2
         return CGSize(width: width, height: width)
     }()
     
@@ -24,7 +24,7 @@ open class KSMediaPickerItemModel: NSObject {
     
     @objc public static let pictureOptions = {() -> PHImageRequestOptions in
         let options = PHImageRequestOptions()
-        options.resizeMode = .none
+        options.resizeMode = .exact
         // 同步获得图片, 只会返回1张图片
         options.isSynchronous = true
         options.isNetworkAccessAllowed = true;
@@ -33,7 +33,7 @@ open class KSMediaPickerItemModel: NSObject {
     
     @objc public static let pictureViewerOptions = {() -> PHImageRequestOptions in
         let options = PHImageRequestOptions()
-        options.resizeMode = .none
+        options.resizeMode = .exact
         options.isSynchronous = false
         options.isNetworkAccessAllowed = true;
         return options
@@ -44,6 +44,7 @@ open class KSMediaPickerItemModel: NSObject {
         options.version = .current
         options.deliveryMode = .automatic
         options.isNetworkAccessAllowed = true;
+
         return options
     }()
     

+ 0 - 2
RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishMediaPicker/View/KSMediaPickerPreviewView.swift

@@ -294,7 +294,6 @@ open class KSMediaPickerPreviewView: UIView {
                 _videoView.isHidden = false
                 _scrollview.isHidden = true
                 _changeSizeButton.isHidden = true
-                _videoView.coverView?.image = itemModel.thumb
                 PHImageManager.default().requestAVAsset(forVideo: asset, options: KSMediaPickerItemModel.videoOptions) {[weak self] (urlAsset, audioMix, info) in
                     guard let videoView = self?._videoView, let videoAsset = urlAsset else {
                         return
@@ -362,7 +361,6 @@ open class KSMediaPickerPreviewView: UIView {
                 }
                 _scrollview.set(frame: CGRect(origin: .zero, size: _changeSizeButton.isSelected ? _minScrollViewSize : _normalScrollViewSize), isNeedLayoutSubviews: true)
                 setNeedsLayout()
-                _scrollview.imageView.image = itemModel.original
                 PHImageManager.default().requestImage(for: asset, targetSize: mainSize, contentMode: .aspectFit, options: KSMediaPickerItemModel.pictureOptions) {[weak self] (image, info) in
                     self?._scrollview.imageView.image = image
                     KingfisherManager.shared.cache.clearMemoryCache()

+ 0 - 6
RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishMediaPicker/View/KSMediaPickerViewImageCell.swift

@@ -95,7 +95,6 @@ open class KSMediaPickerViewImageCell: UICollectionViewCell {
         didSet {
             isLoseFocus = itemModel.isLoseFocus
             let thumb = itemModel.thumb
-            let original = itemModel.original
             if thumb == nil {
                 PHCachingImageManager.default().requestImage(for: itemModel.asset, targetSize: KSMediaPickerItemModel.thumbSize, contentMode:.aspectFit , options: KSMediaPickerItemModel.pictureViewerOptions) {[weak self] (image, info) in
                     self?._updateThumb(image)
@@ -103,11 +102,6 @@ open class KSMediaPickerViewImageCell: UICollectionViewCell {
             } else {
                 imageView.image = thumb
             }
-            if original == nil {
-                PHCachingImageManager.default().requestImage(for: itemModel.asset, targetSize: KSMediaPickerItemModel.originalSize, contentMode:.aspectFit , options: KSMediaPickerItemModel.pictureViewerOptions) {[weak self] (image, info) in
-                    self?.itemModel.original = image
-                }
-            }
             _indView.index = itemModel.index
             itemIsHighlight = itemModel.isHighlight
         }

+ 15 - 161
RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishViewController.swift

@@ -15,7 +15,6 @@ class PublishViewController: BaseViewController {
         super.didReceiveMemoryWarning()
     }
     
-
     deinit {
         NXLLog("deinit")
     }
@@ -47,7 +46,6 @@ class PublishViewController: BaseViewController {
         return cropMediaConfig!
     }
     
-    var selectedAssets = [TLPHAsset]()
     
     override func viewDidLoad() {
         super.viewDidLoad()
@@ -209,36 +207,22 @@ extension PublishViewController :JXSegmentedListContainerViewDataSource {
     func listContainerView(_ listContainerView: JXSegmentedListContainerView, initListAt index: Int) -> JXSegmentedListContainerViewListDelegate {
         switch index {
         case 0:
-//            let mediaVc = KSMediaPickerController(maxVideoItemCount: 1, maxPictureItemCount: 9)
-//            mediaVc.dismissClosure = {
-//                [weak self] in
-//                self?.dismiss(animated: true, completion: nil)
-//            }
-//            mediaVc.cropClosure = {
-//                [weak self] (vItemModel) in
-//                self?.getAvUrlAssetAndCrop(vItemModel)
-//            }
-//            mediaVc.pubImgClosure = {
-//                [weak self] (imageArray) in
-//                let pubVc = PublishEditController()
-//                pubVc.imageArr = imageArray
-//                self?.navigationController?.pushViewController(pubVc, animated: true)
-//            }
-//            return mediaVc
-            let publishMediaPickerVC = TLPhotosPickerViewController()
-            publishMediaPickerVC.delegate = self
-            publishMediaPickerVC.didExceedMaximumNumberOfSelection = { [weak self] (picker) in
-//                self?.showExceededMaximumAlert(vc: picker)
+            let mediaVc = KSMediaPickerController(maxVideoItemCount: 1, maxPictureItemCount: 9)
+            mediaVc.dismissClosure = {
+                [weak self] in
+                self?.dismiss(animated: true, completion: nil)
             }
-            var configure = TLPhotosPickerConfigure()
-            configure.numberOfColumn = 4
-            configure.usedCameraButton = false
-            configure.maxSelectedAssets = 9
-            configure.minSeconds = 3
-            publishMediaPickerVC.configure = configure
-            publishMediaPickerVC.selectedAssets = self.selectedAssets
-            publishMediaPickerVC.logDelegate = self
-            return publishMediaPickerVC
+            mediaVc.cropClosure = {
+                [weak self] (vItemModel) in
+                self?.getAvUrlAssetAndCrop(vItemModel)
+            }
+            mediaVc.pubImgClosure = {
+                [weak self] (imageArray) in
+                let pubVc = PublishEditController()
+                pubVc.imageArr = imageArray
+                self?.navigationController?.pushViewController(pubVc, animated: true)
+            }
+            return mediaVc
         case 1:
             let videoVc = AliyunMagicCameraViewController()
             videoVc.quVideo = mediaConfig
@@ -290,136 +274,6 @@ extension PublishViewController :JXSegmentedListContainerViewDataSource {
     }
 }
 
-extension PublishViewController: TLPhotosPickerViewControllerDelegate {
-    func deninedAuthoization() {
-        
-    }
-    func dismissPhotoPicker(withPHAssets: [PHAsset]) {
-        self.dismiss(animated: true, completion: nil)
-    }
-    func dismissPhotoPicker(withTLPHAssets: [TLPHAsset]) {
-        // use selected order, fullresolution image
-        self.selectedAssets = withTLPHAssets
-        getFirstSelectedImage()
-        //iCloud or video
-        //        getAsyncCopyTemporaryFile()
-    }
-    func dismissComplete() {
-        self.dismiss(animated: true) {
-            
-        }
-    }
-    func photoPickerDidCancel() {
-        self.dismiss(animated: true, completion: nil)
-    }
-    func canSelectAsset(phAsset: PHAsset) -> Bool {
-        return true
-    }
-    func didExceedMaximumNumberOfSelection(picker: TLPhotosPickerViewController) {
-        self.showExceededMaximumAlert(vc: picker)
-
-    }
-    func handleNoAlbumPermissions(picker: TLPhotosPickerViewController) {
-        self.dismiss(animated: true) {
-            let alert = UIAlertController(title: "", message: "Denied albums permissions granted", preferredStyle: .alert)
-            alert.addAction(UIAlertAction(title: "Ok", style: .default, handler: nil))
-            self.present(alert, animated: true, completion: nil)
-        }
-    }
-    func handleNoCameraPermissions(picker: TLPhotosPickerViewController) {
-        let alert = UIAlertController(title: "", message: "Denied camera permissions granted", preferredStyle: .alert)
-        alert.addAction(UIAlertAction(title: "Ok", style: .default, handler: nil))
-        self.present(alert, animated: true, completion: nil)
-    }
-
-    func exportVideo() {
-        if let asset = self.selectedAssets.first, asset.type == .video {
-            asset.exportVideoFile(progressBlock: { (progress) in
-                print(progress)
-            }) { (url, mimeType) in
-                print("completion\(url)")
-                print(mimeType)
-            }
-        }
-    }
-    
-    func getAsyncCopyTemporaryFile() {
-        if let asset = self.selectedAssets.first {
-            asset.tempCopyMediaFile(convertLivePhotosToJPG: false, progressBlock: { (progress) in
-                print(progress)
-            }, completionBlock: { (url, mimeType) in
-                print("completion\(url)")
-                print(mimeType)
-            })
-        }
-    }
-    
-    func getFirstSelectedImage() {
-        if let asset = self.selectedAssets.first {
-            if asset.type == .video {
-                asset.videoSize(completion: { [weak self] (size) in
-//                    self?.label.text = "video file size\(size)"
-                })
-                return
-            }
-            if let image = asset.fullResolutionImage {
-                print(image)
-//                self.label.text = "local storage image"
-//                self.imageView.image = image
-            }else {
-                print("Can't get image at local storage, try download image")
-                asset.cloudImageDownload(progressBlock: { [weak self] (progress) in
-                    DispatchQueue.main.async {
-//                        self?.label.text = "download \(100*progress)%"
-                        print(progress)
-                    }
-                    }, completionBlock: { [weak self] (image) in
-                        if let image = image {
-                            //use image
-                            DispatchQueue.main.async {
-//                                self?.label.text = "complete download"
-//                                self?.imageView.image = image
-                            }
-                        }
-                })
-            }
-        }
-    }
-    
-    func showExceededMaximumAlert(vc: UIViewController) {
-        
-        let alert = UIAlertController(title: "", message: "Exceed Maximum Number Of Selection", preferredStyle: .alert)
-        alert.addAction(UIAlertAction(title: "Ok", style: .default, handler: nil))
-        vc.present(alert, animated: true, completion: nil)
-    }
-    
-    func showUnsatisifiedSizeAlert(vc: UIViewController) {
-        let alert = UIAlertController(title: "Oups!", message: "The required size is: 300 x 300", preferredStyle: .alert)
-        alert.addAction(UIAlertAction(title: "Ok", style: .default, handler: nil))
-        vc.present(alert, animated: true, completion: nil)
-    }
-}
-
-extension PublishViewController: TLPhotosPickerLogDelegate {
-    //For Log User Interaction
-    func selectedCameraCell(picker: TLPhotosPickerViewController) {
-        print("selectedCameraCell")
-    }
-    
-    func selectedPhoto(picker: TLPhotosPickerViewController, at: Int) {
-        print("selectedPhoto")
-    }
-    
-    func deselectedPhoto(picker: TLPhotosPickerViewController, at: Int) {
-        print("deselectedPhoto")
-    }
-    
-    func selectedAlbum(picker: TLPhotosPickerViewController, title: String, at: Int) {
-        print("selectedAlbum")
-    }
-}
-
-
 // MARK: - AliyunCropViewControllerDelegate
 extension PublishViewController: AliyunCropViewControllerDelegate {
     func cropViewControllerExit() {