Browse Source

add 多素材支持

wenweiwei 3 năm trước cách đây
mục cha
commit
7859195b0a

+ 6 - 4
Introduce.xcodeproj/project.pbxproj

@@ -16,7 +16,7 @@
 		4A426DF22754A1E300B3733B /* INTabbarController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4A426DF12754A1E300B3733B /* INTabbarController.swift */; };
 		4A426DF52754A27D00B3733B /* INRecorderController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4A426DF42754A27D00B3733B /* INRecorderController.swift */; };
 		4A426DFA2754A47700B3733B /* INPhotoVideosController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4A426DF92754A47700B3733B /* INPhotoVideosController.swift */; };
-		4A426DFC2754A4B200B3733B /* INIntrocudeController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4A426DFB2754A4B200B3733B /* INIntrocudeController.swift */; };
+		4A426DFC2754A4B200B3733B /* INIntroduceController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4A426DFB2754A4B200B3733B /* INIntroduceController.swift */; };
 		4A426DFE2754A4F600B3733B /* INVideoExportController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4A426DFD2754A4F600B3733B /* INVideoExportController.swift */; };
 		BFC6C47BC8163110D4E205C0 /* Pods_Introduce.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3D67E85C017389B87957100F /* Pods_Introduce.framework */; };
 /* End PBXBuildFile section */
@@ -35,7 +35,7 @@
 		4A426DF12754A1E300B3733B /* INTabbarController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = INTabbarController.swift; sourceTree = "<group>"; };
 		4A426DF42754A27D00B3733B /* INRecorderController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = INRecorderController.swift; sourceTree = "<group>"; };
 		4A426DF92754A47700B3733B /* INPhotoVideosController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = INPhotoVideosController.swift; sourceTree = "<group>"; };
-		4A426DFB2754A4B200B3733B /* INIntrocudeController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = INIntrocudeController.swift; sourceTree = "<group>"; };
+		4A426DFB2754A4B200B3733B /* INIntroduceController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = INIntroduceController.swift; sourceTree = "<group>"; };
 		4A426DFD2754A4F600B3733B /* INVideoExportController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = INVideoExportController.swift; sourceTree = "<group>"; };
 		F6FE9FC563C2B8CC6005F8C8 /* Pods-Introduce.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Introduce.debug.xcconfig"; path = "Target Support Files/Pods-Introduce/Pods-Introduce.debug.xcconfig"; sourceTree = "<group>"; };
 /* End PBXFileReference section */
@@ -109,7 +109,7 @@
 			children = (
 				4A426DF42754A27D00B3733B /* INRecorderController.swift */,
 				4A426DF92754A47700B3733B /* INPhotoVideosController.swift */,
-				4A426DFB2754A4B200B3733B /* INIntrocudeController.swift */,
+				4A426DFB2754A4B200B3733B /* INIntroduceController.swift */,
 				4A426DFD2754A4F600B3733B /* INVideoExportController.swift */,
 			);
 			path = Record;
@@ -167,8 +167,10 @@
 		4A426DD1275484DF00B3733B /* Project object */ = {
 			isa = PBXProject;
 			attributes = {
+				CLASSPREFIX = IN;
 				LastSwiftUpdateCheck = 1310;
 				LastUpgradeCheck = 1310;
+				ORGANIZATIONNAME = BytesFlow;
 				TargetAttributes = {
 					4A426DD8275484DF00B3733B = {
 						CreatedOnToolsVersion = 13.1;
@@ -276,7 +278,7 @@
 				4A426DDD275484DF00B3733B /* AppDelegate.swift in Sources */,
 				4A426DF52754A27D00B3733B /* INRecorderController.swift in Sources */,
 				4A426DFE2754A4F600B3733B /* INVideoExportController.swift in Sources */,
-				4A426DFC2754A4B200B3733B /* INIntrocudeController.swift in Sources */,
+				4A426DFC2754A4B200B3733B /* INIntroduceController.swift in Sources */,
 				4A426DF22754A1E300B3733B /* INTabbarController.swift in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;

+ 15 - 7
Introduce/Record/INIntrocudeController.swift → Introduce/Record/INIntroduceController.swift

@@ -12,7 +12,8 @@ import Foundation
 import Photos
 import UIKit
 
-class INIntrocudeController: BFBaseViewController {
+class INIntroduceController: BFBaseViewController {
+    var stripSwithView: BFStripSwithView?
     let exportBtn = UIButton()
     var assets: [PHAsset]? {
         didSet {
@@ -56,16 +57,23 @@ class INIntrocudeController: BFBaseViewController {
         exportBtn.titleLabel?.font = UIFont.systemFont(ofSize: 16)
         exportBtn.addTarget(self, action: #selector(exportAction), for: .touchUpInside)
         navHeadImageView?.addSubview(exportBtn)
-        exportBtn.snp.makeConstraints { make in
-            make.right.equalTo(-12)
-            make.width.equalTo(60)
-            make.height.equalTo(36)
-            make.centerY.equalTo(backButton!)
-        }
+        exportBtn.frame = CGRect(x: (navHeadImageView?.frame.width ?? 0) - 12 - 60, y: 0, width: 60, height: 36)
+        exportBtn.center.y = backButton?.center.y ?? 0
 
         addChild(recordScreenVC)
         recordScreenVC.view.frame = view.frame
         view.addSubview(recordScreenVC.view)
+        recordScreenVC.changeItemHandle = { [weak self] index in
+            self?.stripSwithView?.changeSwitchStatus(index: index)
+        }
+        if assets != nil, (assets?.count ?? 0) > 1 {
+            stripSwithView = BFStripSwithView(frame: CGRect(x: (backButton?.frame.maxX ?? 0), y: 0, width: exportBtn.frame.minX - (backButton?.frame.maxX ?? 0) - 10, height: cDevice_iPhoneNavBarHei), items: assets?.count ?? 1)
+            stripSwithView?.center.y = backButton?.center.y ?? 0
+            stripSwithView?.itemClickHandle = { [weak self] _, index in
+                self?.recordScreenVC.updateContentOffset(index: index)
+            }
+            navHeadImageView?.addSubview(stripSwithView!)
+        }
     }
 
     override func backBtnClick() {

+ 1 - 1
Introduce/Record/INPhotoVideosController.swift

@@ -198,7 +198,7 @@ class INPhotoVideosController: BFBaseViewController {
 
     override func rightBtnClick(sender _: UIButton) {
         if let assets = chosedAsset {
-            let vc = INIntrocudeController()
+            let vc = INIntroduceController()
             vc.assets = assets
             navigationController?.pushViewController(vc, animated: true)
         } else {