Pārlūkot izejas kodu

4.3a改造:重写了基类VC

kln 1 nedēļu atpakaļ
vecāks
revīzija
cae19670e1
22 mainītis faili ar 245 papildinājumiem un 546 dzēšanām
  1. 10 28
      AIPlayRingtones.xcodeproj/project.pbxproj
  2. 1 0
      AIPlayRingtones/AIPlayRingtones-Bridging-Header.h
  3. 2 2
      AIPlayRingtones/AppPage/APAudioToRingVC/APAudioToRingVC+View.swift
  4. 9 4
      AIPlayRingtones/AppPage/APAudioToRingVC/APAudioToRingVC.swift
  5. 3 3
      AIPlayRingtones/AppPage/APMyRingVC/ASMyRingVC.swift
  6. 1 1
      AIPlayRingtones/AppPage/APRingTonesVC/APRingStyleVC/APRingStyleVC.swift
  7. 2 2
      AIPlayRingtones/AppPage/APRingTonesVC/APRingTonesVC/APRingTonesVC+View.swift
  8. 8 3
      AIPlayRingtones/AppPage/APRingTonesVC/APRingTonesVC/APRingTonesVC.swift
  9. 20 0
      AIPlayRingtones/AppPage/APSettingVC/APSettingModel.swift
  10. 3 3
      AIPlayRingtones/AppPage/APSettingVC/APSettingVC+Col.swift
  11. 14 16
      AIPlayRingtones/AppPage/APSettingVC/APSettingVC.swift
  12. 1 1
      AIPlayRingtones/AppPage/APSettingVC/ASTutorialsVC/ASTutorialsVC.swift
  13. 1 1
      AIPlayRingtones/AppPage/ASBusinessWebVC/ASBusinessWebVC.swift
  14. 1 1
      AIPlayRingtones/AppPage/ASRingGeneratorVC/ASRingGeneratorBaseVC.swift
  15. 6 1
      AIPlayRingtones/AppPage/ASRingGeneratorVC/ASRingGeneratorVC.swift
  16. 0 173
      AIPlayRingtones/Classes/BaseClass/TSBaseNavigationBarView.swift
  17. 0 153
      AIPlayRingtones/Classes/BaseClass/TSBaseVC.swift
  18. 0 152
      AIPlayRingtones/Classes/BaseClass/TSBasicItemModel.swift
  19. 1 1
      AIPlayRingtones/Classes/GlobalImports/GlobalMacros.h
  20. 33 0
      AIPlayRingtones/Common/BaseClass/ASBaseViewController.h
  21. 128 0
      AIPlayRingtones/Common/BaseClass/ASBaseViewController.m
  22. 1 1
      AIPlayRingtones/Common/BaseClass/ASNormalNavigationBarView.m

+ 10 - 28
AIPlayRingtones.xcodeproj/project.pbxproj

@@ -25,12 +25,10 @@
 		3DBEA0CD2DE69B2E000C6859 /* TSSaveSuccessTool.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3DBEA0B72DE69B2E000C6859 /* TSSaveSuccessTool.swift */; };
 		3DBEA0CE2DE69B2E000C6859 /* TSSimpleCollectionView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3DBEA0B52DE69B2E000C6859 /* TSSimpleCollectionView.swift */; };
 		3DBEA0CF2DE69B2E000C6859 /* WindowHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3DBEA0AF2DE69B2E000C6859 /* WindowHelper.swift */; };
-		3DBEA0D12DE69B2E000C6859 /* TSBasicItemModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3DBEA07A2DE69B2E000C6859 /* TSBasicItemModel.swift */; };
 		3DBEA0D22DE69B2E000C6859 /* Array+Ex.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3DBEA0832DE69B2E000C6859 /* Array+Ex.swift */; };
 		3DBEA0D92DE69B2E000C6859 /* UIImageView+Ex.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3DBEA0912DE69B2E000C6859 /* UIImageView+Ex.swift */; };
 		3DBEA0E12DE69B2E000C6859 /* Color+Ex.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3DBEA07F2DE69B2E000C6859 /* Color+Ex.swift */; };
 		3DBEA0E82DE69B2E000C6859 /* UIView+Ex.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3DBEA0962DE69B2E000C6859 /* UIView+Ex.swift */; };
-		3DBEA0E92DE69B2E000C6859 /* TSBaseVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3DBEA0772DE69B2E000C6859 /* TSBaseVC.swift */; };
 		3DBEA0EA2DE69B2E000C6859 /* UIView+Rotating.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3DBEA0982DE69B2E000C6859 /* UIView+Rotating.swift */; };
 		3DBEA0EB2DE69B2E000C6859 /* Text+Ex.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3DBEA0812DE69B2E000C6859 /* Text+Ex.swift */; };
 		3DBEA0EC2DE69B2E000C6859 /* UILabel+Ex.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3DBEA0922DE69B2E000C6859 /* UILabel+Ex.swift */; };
@@ -39,7 +37,6 @@
 		3DBEA0F12DE69B2E000C6859 /* TSFileManagerTool.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3DBEA0AA2DE69B2E000C6859 /* TSFileManagerTool.swift */; };
 		3DBEA0F32DE69B2E000C6859 /* TSRandomTextTool.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3DBEA0A22DE69B2E000C6859 /* TSRandomTextTool.swift */; };
 		3DBEA0F62DE69B2E000C6859 /* TSCustomAlertController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3DBEA0A82DE69B2E000C6859 /* TSCustomAlertController.swift */; };
-		3DBEA0FA2DE69B2E000C6859 /* TSBaseNavigationBarView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3DBEA0742DE69B2E000C6859 /* TSBaseNavigationBarView.swift */; };
 		3DBEA0FC2DE69B2E000C6859 /* UIFont+Ex.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3DBEA08F2DE69B2E000C6859 /* UIFont+Ex.swift */; };
 		3DBEA0FE2DE69B2E000C6859 /* UIButton+Ex.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3DBEA08C2DE69B2E000C6859 /* UIButton+Ex.swift */; };
 		3DBEA0FF2DE69B2E000C6859 /* TSCustomStackView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3DBEA0C02DE69B2E000C6859 /* TSCustomStackView.swift */; };
@@ -64,6 +61,8 @@
 		3DBEA1362DE6D9A3000C6859 /* ASBaseModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3DBEA1352DE6D9A2000C6859 /* ASBaseModel.swift */; };
 		3DBEA13D2DE6DC38000C6859 /* ASBaseNavContentBarView.m in Sources */ = {isa = PBXBuildFile; fileRef = 3DBEA13C2DE6DC38000C6859 /* ASBaseNavContentBarView.m */; };
 		3DBEA1402DE6DD18000C6859 /* ASNormalNavigationBarView.m in Sources */ = {isa = PBXBuildFile; fileRef = 3DBEA13F2DE6DD18000C6859 /* ASNormalNavigationBarView.m */; };
+		3DBEA1442DE6E018000C6859 /* ASBaseViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3DBEA1432DE6E018000C6859 /* ASBaseViewController.m */; };
+		3DBEA1462DE6E31C000C6859 /* APSettingModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3DBEA1452DE6E310000C6859 /* APSettingModel.swift */; };
 		3DCD56F32DDAE3E3004AAB5B /* ASRingToneCellView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3DCD56F22DDAE3DF004AAB5B /* ASRingToneCellView.swift */; };
 		3DCD56F52DDAE42A004AAB5B /* ASViewTool.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3DCD56F42DDAE421004AAB5B /* ASViewTool.swift */; };
 		3DCD56F92DDAE481004AAB5B /* TSBusinessAudioPlayer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3DCD56F62DDAE481004AAB5B /* TSBusinessAudioPlayer.swift */; };
@@ -152,9 +151,6 @@
 		3DB4D4A92DDDCEA50082596A /* Poppins-BoldItalic.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Poppins-BoldItalic.otf"; sourceTree = "<group>"; };
 		3DB4D4B12DDF0B940082596A /* FakeBlurView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FakeBlurView.swift; sourceTree = "<group>"; };
 		3DB4D4B42DE025910082596A /* ASTutorialsVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ASTutorialsVC.swift; sourceTree = "<group>"; };
-		3DBEA0742DE69B2E000C6859 /* TSBaseNavigationBarView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TSBaseNavigationBarView.swift; sourceTree = "<group>"; };
-		3DBEA0772DE69B2E000C6859 /* TSBaseVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TSBaseVC.swift; sourceTree = "<group>"; };
-		3DBEA07A2DE69B2E000C6859 /* TSBasicItemModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TSBasicItemModel.swift; sourceTree = "<group>"; };
 		3DBEA07F2DE69B2E000C6859 /* Color+Ex.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Color+Ex.swift"; sourceTree = "<group>"; };
 		3DBEA0802DE69B2E000C6859 /* Font+Ex.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Font+Ex.swift"; sourceTree = "<group>"; };
 		3DBEA0812DE69B2E000C6859 /* Text+Ex.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Text+Ex.swift"; sourceTree = "<group>"; };
@@ -206,6 +202,9 @@
 		3DBEA13C2DE6DC38000C6859 /* ASBaseNavContentBarView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ASBaseNavContentBarView.m; sourceTree = "<group>"; };
 		3DBEA13E2DE6DD18000C6859 /* ASNormalNavigationBarView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ASNormalNavigationBarView.h; sourceTree = "<group>"; };
 		3DBEA13F2DE6DD18000C6859 /* ASNormalNavigationBarView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ASNormalNavigationBarView.m; sourceTree = "<group>"; };
+		3DBEA1422DE6E018000C6859 /* ASBaseViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ASBaseViewController.h; sourceTree = "<group>"; };
+		3DBEA1432DE6E018000C6859 /* ASBaseViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ASBaseViewController.m; sourceTree = "<group>"; };
+		3DBEA1452DE6E310000C6859 /* APSettingModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = APSettingModel.swift; sourceTree = "<group>"; };
 		3DCD56F22DDAE3DF004AAB5B /* ASRingToneCellView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ASRingToneCellView.swift; sourceTree = "<group>"; };
 		3DCD56F42DDAE421004AAB5B /* ASViewTool.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ASViewTool.swift; sourceTree = "<group>"; };
 		3DCD56F62DDAE481004AAB5B /* TSBusinessAudioPlayer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TSBusinessAudioPlayer.swift; sourceTree = "<group>"; };
@@ -341,23 +340,6 @@
 			path = ASTutorialsVC;
 			sourceTree = "<group>";
 		};
-		3DBEA07B2DE69B2E000C6859 /* BaseClass */ = {
-			isa = PBXGroup;
-			children = (
-				3DBEA0742DE69B2E000C6859 /* TSBaseNavigationBarView.swift */,
-				3DBEA0772DE69B2E000C6859 /* TSBaseVC.swift */,
-				3DBEA07A2DE69B2E000C6859 /* TSBasicItemModel.swift */,
-			);
-			path = BaseClass;
-			sourceTree = "<group>";
-		};
-		3DBEA07E2DE69B2E000C6859 /* Config */ = {
-			isa = PBXGroup;
-			children = (
-			);
-			path = Config;
-			sourceTree = "<group>";
-		};
 		3DBEA0822DE69B2E000C6859 /* SwiftUI */ = {
 			isa = PBXGroup;
 			children = (
@@ -460,8 +442,6 @@
 		3DBEA0C72DE69B2E000C6859 /* Classes */ = {
 			isa = PBXGroup;
 			children = (
-				3DBEA07B2DE69B2E000C6859 /* BaseClass */,
-				3DBEA07E2DE69B2E000C6859 /* Config */,
 				3DBEA09B2DE69B2E000C6859 /* Ex */,
 				3DBEA09D2DE69B2E000C6859 /* GlobalImports */,
 				3DBEA0B02DE69B2E000C6859 /* Tool */,
@@ -515,6 +495,8 @@
 				3DBEA13C2DE6DC38000C6859 /* ASBaseNavContentBarView.m */,
 				3DBEA13E2DE6DD18000C6859 /* ASNormalNavigationBarView.h */,
 				3DBEA13F2DE6DD18000C6859 /* ASNormalNavigationBarView.m */,
+				3DBEA1422DE6E018000C6859 /* ASBaseViewController.h */,
+				3DBEA1432DE6E018000C6859 /* ASBaseViewController.m */,
 			);
 			path = BaseClass;
 			sourceTree = "<group>";
@@ -751,6 +733,7 @@
 				3DB4D4B32DE0257A0082596A /* ASTutorialsVC */,
 				A848F8AC2DD6D75800B746EC /* APSettingVC.swift */,
 				3DB4D4A42DDC8E7B0082596A /* APSettingVC+Col.swift */,
+				3DBEA1452DE6E310000C6859 /* APSettingModel.swift */,
 			);
 			path = APSettingVC;
 			sourceTree = "<group>";
@@ -1042,6 +1025,7 @@
 				3DB4D4992DDC28E70082596A /* APAudioToRingVC+StackView.swift in Sources */,
 				3DBEA11E2DE6B229000C6859 /* NSString+AS.m in Sources */,
 				3DCD56F52DDAE42A004AAB5B /* ASViewTool.swift in Sources */,
+				3DBEA1462DE6E31C000C6859 /* APSettingModel.swift in Sources */,
 				3DB4D4972DDC28D40082596A /* APAudioToRingVC+View.swift in Sources */,
 				A800FEBD2DDACCD4009DABDC /* ASRingGeneratorBaseVC.swift in Sources */,
 				A800FEB62DDAC764009DABDC /* ASGeneratorErrorView.swift in Sources */,
@@ -1059,6 +1043,7 @@
 				A848F8FC2DD753A000B746EC /* ASProgressState.swift in Sources */,
 				A848F8A92DD6D74A00B746EC /* APAudioToRingVC.swift in Sources */,
 				A848F8AD2DD6D75900B746EC /* APSettingVC.swift in Sources */,
+				3DBEA1442DE6E018000C6859 /* ASBaseViewController.m in Sources */,
 				A848F8912DD6D50000B746EC /* Common.swift in Sources */,
 				3DCD57192DDB1158004AAB5B /* AudioTool.swift in Sources */,
 				3DBEA13D2DE6DC38000C6859 /* ASBaseNavContentBarView.m in Sources */,
@@ -1107,13 +1092,11 @@
 				3DBEA0CD2DE69B2E000C6859 /* TSSaveSuccessTool.swift in Sources */,
 				3DBEA0CE2DE69B2E000C6859 /* TSSimpleCollectionView.swift in Sources */,
 				3DBEA0CF2DE69B2E000C6859 /* WindowHelper.swift in Sources */,
-				3DBEA0D12DE69B2E000C6859 /* TSBasicItemModel.swift in Sources */,
 				3DBEA0D22DE69B2E000C6859 /* Array+Ex.swift in Sources */,
 				3DBEA1312DE6D825000C6859 /* ASBaseCollectionCell.m in Sources */,
 				3DBEA0D92DE69B2E000C6859 /* UIImageView+Ex.swift in Sources */,
 				3DBEA0E12DE69B2E000C6859 /* Color+Ex.swift in Sources */,
 				3DBEA0E82DE69B2E000C6859 /* UIView+Ex.swift in Sources */,
-				3DBEA0E92DE69B2E000C6859 /* TSBaseVC.swift in Sources */,
 				3DBEA0EA2DE69B2E000C6859 /* UIView+Rotating.swift in Sources */,
 				3DBEA12B2DE6BCE3000C6859 /* ASBaseNavigationController.m in Sources */,
 				3DBEA0EB2DE69B2E000C6859 /* Text+Ex.swift in Sources */,
@@ -1123,7 +1106,6 @@
 				3DBEA0F12DE69B2E000C6859 /* TSFileManagerTool.swift in Sources */,
 				3DBEA0F32DE69B2E000C6859 /* TSRandomTextTool.swift in Sources */,
 				3DBEA0F62DE69B2E000C6859 /* TSCustomAlertController.swift in Sources */,
-				3DBEA0FA2DE69B2E000C6859 /* TSBaseNavigationBarView.swift in Sources */,
 				3DBEA0FC2DE69B2E000C6859 /* UIFont+Ex.swift in Sources */,
 				3DBEA0FE2DE69B2E000C6859 /* UIButton+Ex.swift in Sources */,
 				3DBEA0FF2DE69B2E000C6859 /* TSCustomStackView.swift in Sources */,

+ 1 - 0
AIPlayRingtones/AIPlayRingtones-Bridging-Header.h

@@ -14,3 +14,4 @@
 #import "ASBaseCollectionReusableView.h"
 #import "ASBaseNavContentBarView.h"
 #import "ASNormalNavigationBarView.h"
+#import "ASBaseViewController.h"

+ 2 - 2
AIPlayRingtones/AppPage/APAudioToRingVC/APAudioToRingVC+View.swift

@@ -15,8 +15,8 @@ extension APAudioToRingVC {
 //        return vipBtn
 //    }
     
-    func creatNavBarView()->TSBaseNavContentBarView{
-        let navBarView = TSBaseNavContentBarView()
+    func creatNavBarView()->ASBaseNavContentBarView{
+        let navBarView = ASBaseNavContentBarView()
 
         let titleImageView = UIImageView.createImageView(imageName: "nav_title_aiRingtone", contentMode: .scaleToFill)
         navBarView.barView.addSubview(titleImageView)

+ 9 - 4
AIPlayRingtones/AppPage/APAudioToRingVC/APAudioToRingVC.swift

@@ -5,11 +5,13 @@
 //  Created by 100Years on 2025/5/15.
 //
 
-
+import Combine
 import MobileCoreServices // 用于定义文件类型
-class APAudioToRingVC: TSBaseVC {
-    lazy var navBarView: TSBaseNavContentBarView = {
-        let navBarView = TSBaseNavContentBarView()
+class APAudioToRingVC: ASBaseViewController {
+    public var cancellable: [AnyCancellable] = []
+    
+    lazy var navBarView: ASBaseNavContentBarView = {
+        let navBarView = ASBaseNavContentBarView()
         
         let titleImageView = UIImageView.createImageView(imageName: "nav_title_audioRingtone", contentMode: .scaleToFill)
         navBarView.barView.addSubview(titleImageView)
@@ -86,6 +88,9 @@ class APAudioToRingVC: TSBaseVC {
         super.viewWillDisappear(animated)
         TSBusinessAudioPlayer.shared.stop()
     }
+    deinit {
+        cancellable.removeAll()
+    }
 }
 
 extension APAudioToRingVC {

+ 3 - 3
AIPlayRingtones/AppPage/APMyRingVC/ASMyRingVC.swift

@@ -5,13 +5,13 @@
 //  Created by 100Years on 2025/5/15.
 //
 import SwipeCellKit
-class APMyRingVC: TSBaseVC {
+class APMyRingVC: ASBaseViewController {
     
     var listModelArray: [ASActionInfoModel] = []
     var dataChangedBlock:(()->Void)?
     
-    lazy var navBarView: TSBaseNavContentBarView = {
-        let navBarView = TSBaseNavContentBarView()
+    lazy var navBarView: ASBaseNavContentBarView = {
+        let navBarView = ASBaseNavContentBarView()
 
         let titleImageView = UIImageView.createImageView(imageName: "nav_title_myRingtones", contentMode: .scaleToFill)
         navBarView.barView.addSubview(titleImageView)

+ 1 - 1
AIPlayRingtones/AppPage/APRingTonesVC/APRingStyleVC/APRingStyleVC.swift

@@ -6,7 +6,7 @@
 //
 
 import ObjectMapper
-class APRingStyleVC: TSBaseVC {
+class APRingStyleVC: ASBaseViewController {
     
     var selectedCompleted:((ASGenerateStyleModel,Int)->Void)?
 

+ 2 - 2
AIPlayRingtones/AppPage/APRingTonesVC/APRingTonesVC/APRingTonesVC+View.swift

@@ -17,8 +17,8 @@ extension APRingTonesVC {
 //    }
     
     
-    func creatNavBarView()->TSBaseNavContentBarView{
-        let navBarView = TSBaseNavContentBarView()
+    func creatNavBarView()->ASBaseNavContentBarView{
+        let navBarView = ASBaseNavContentBarView()
 
         let titleImageView = UIImageView.createImageView(imageName: "nav_title_aiRingtone", contentMode: .scaleToFill)
         navBarView.barView.addSubview(titleImageView)

+ 8 - 3
AIPlayRingtones/AppPage/APRingTonesVC/APRingTonesVC/APRingTonesVC.swift

@@ -6,21 +6,21 @@
 //
 
 import Combine
-class APRingTonesVC: TSBaseVC {
+class APRingTonesVC: ASBaseViewController {
     lazy var viewModel: APRingTonesVM = {
         let viewModel = APRingTonesVM()
         return viewModel
     }()
 
 //    lazy var vipBtn: UIButton = creatVipBtn()
-    lazy var navBarView: TSBaseNavContentBarView = creatNavBarView()
+    lazy var navBarView: ASBaseNavContentBarView = creatNavBarView()
     lazy var cusStackView: TSCustomStackView = creatCusStackView()
     lazy var customTextView: ASPromptTextView = creatCustomTextView()
     lazy var secStyleView: ASGenerateDurationColView = creatDurationCollectionView()
     lazy var ringStyleVC: APRingStyleVC = creatRingStyleVC()
     lazy var creatBtnView: ASAppBtnView = creatCreatBtnView()
     
-    
+    public var cancellable: [AnyCancellable] = []
     override func createView() {
         let tapGesture = UITapGestureRecognizer(target: self, action: #selector(clickView))
         tapGesture.cancelsTouchesInView = false
@@ -70,6 +70,11 @@ class APRingTonesVC: TSBaseVC {
             }
         }
     }
+    
+    deinit {
+        cancellable.removeAll()
+    }
+    
 }
 
 

+ 20 - 0
AIPlayRingtones/AppPage/APSettingVC/APSettingModel.swift

@@ -0,0 +1,20 @@
+//
+//  APSettingModel.swift
+//  AIPlayRingtones
+//
+//  Created by mini on 2025/5/27.
+//
+
+class ASSectionModel {
+    
+    open var itemsArray: [ASItemModel] = []
+}
+
+class ASItemModel {
+    
+    public var tapBlock: ((ASItemModel, Int, Any?) -> Void)?
+    public var leftImageName: String?
+    public var leftImage: UIImage?
+    public var leftTitle: String?
+    public var rightIsHave: Bool = false
+}

+ 3 - 3
AIPlayRingtones/AppPage/APSettingVC/APSettingVC+Col.swift

@@ -31,8 +31,8 @@ extension APSettingVC {
     
     func createItemModel(leftTitle: String,
                          rightIsHave: Bool,
-                        tapBlock: @escaping ((TSBasicItemModel, Int, Any?) -> Void)) -> TSBasicItemModel {
-        let model = TSBasicItemModel()
+                        tapBlock: @escaping ((ASItemModel, Int, Any?) -> Void)) -> ASItemModel {
+        let model = ASItemModel()
         model.leftTitle = leftTitle
         model.rightIsHave = rightIsHave
         model.tapBlock = tapBlock
@@ -77,7 +77,7 @@ extension APSettingVC: UICollectionViewDataSource ,UICollectionViewDelegate {
 class APSettingCell: ASBaseCollectionCell {
     
     static let cellID = "APSettingCell"
-    var itemModel:TSBasicItemModel = TSBasicItemModel(){
+    var itemModel:ASItemModel = ASItemModel(){
         didSet{
             titleLab.text = itemModel.leftTitle
             if itemModel.rightIsHave {

+ 14 - 16
AIPlayRingtones/AppPage/APSettingVC/APSettingVC.swift

@@ -7,10 +7,10 @@
 
 import StoreKit
 
-class APSettingVC: TSBaseVC {
+class APSettingVC: ASBaseViewController {
     
-    lazy var navBarView: TSBaseNavContentBarView = {
-        let navBarView = TSBaseNavContentBarView()
+    lazy var navBarView: ASBaseNavContentBarView = {
+        let navBarView = ASBaseNavContentBarView()
 
         let titleImageView = UIImageView.createImageView(imageName: "nav_title_setting", contentMode: .scaleToFill)
         navBarView.barView.addSubview(titleImageView)
@@ -30,13 +30,13 @@ class APSettingVC: TSBaseVC {
     
     
     let appid = "6746234900"
-    lazy var dataArray: [TSBasicSectionModel] = {
-        var dataArray = [TSBasicSectionModel]()
-        let sectionModel = TSBasicSectionModel()
+    lazy var dataArray: [ASSectionModel] = {
+        var dataArray = [ASSectionModel]()
+        let sectionModel = ASSectionModel()
         dataArray.append(sectionModel)
 
         //教程
-        sectionModel.addSubItemModel(
+        sectionModel.itemsArray.append(
             createItemModel(
                 leftTitle: "How to use?".localized,
                 rightIsHave: true,
@@ -46,7 +46,7 @@ class APSettingVC: TSBaseVC {
         }))
         
         //评价
-        sectionModel.addSubItemModel(
+        sectionModel.itemsArray.append(
             createItemModel(
                 leftTitle: "Rate us".localized,
                 rightIsHave: true,
@@ -77,7 +77,7 @@ class APSettingVC: TSBaseVC {
         }))
         
         //分享
-        sectionModel.addSubItemModel(
+        sectionModel.itemsArray.append(
             createItemModel(
                 leftTitle: "Share us".localized,
                 rightIsHave: true,
@@ -85,11 +85,9 @@ class APSettingVC: TSBaseVC {
                    guard let self = self else { return }
                     
                     let httpAppStoreLink = "https://apps.apple.com/app/id\(appid)"
-                    let text = "Space"
+                    let final = ShareActivityItemProvider(placeholderItem: UIImage(named: "App-Icon")!.compressImageSize(to: CGSize(width: 100, height: 100)))
                     let url = URL(string: httpAppStoreLink)!
-                    let image = UIImage(named: "App-Icon")!.compressImageSize(to: CGSize(width: 100, height: 100))
-                    let final = ShareActivityItemProvider(placeholderItem: image)
-                    let vc = UIActivityViewController(activityItems: [url, final, text], applicationActivities: nil)
+                    let vc = UIActivityViewController(activityItems: [url, final], applicationActivities: nil)
                     vc.completionWithItemsHandler = { activity, _, _, _ in
                         if let type = activity, type == .copyToPasteboard {
                             UIPasteboard.general.string = httpAppStoreLink
@@ -101,7 +99,7 @@ class APSettingVC: TSBaseVC {
         }))
         
         //隐私协议
-        sectionModel.addSubItemModel(
+        sectionModel.itemsArray.append(
             createItemModel(
                 leftTitle: "Privacy Policy".localized,
                 rightIsHave: true,
@@ -113,7 +111,7 @@ class APSettingVC: TSBaseVC {
         }))
         
         //服务条框
-        sectionModel.addSubItemModel(
+        sectionModel.itemsArray.append(
             createItemModel(
                 leftTitle: "Terms of Service".localized,
                 rightIsHave: true,
@@ -125,7 +123,7 @@ class APSettingVC: TSBaseVC {
         }))
         
         //关于我们
-        sectionModel.addSubItemModel(
+        sectionModel.itemsArray.append(
             createItemModel(
                 leftTitle: "About us".localized,
                 rightIsHave: false,

+ 1 - 1
AIPlayRingtones/AppPage/APSettingVC/ASTutorialsVC/ASTutorialsVC.swift

@@ -5,7 +5,7 @@
 //  Created by mini on 2025/5/22.
 //
 
-class ASTutorialsVC: TSBaseVC {
+class ASTutorialsVC: ASBaseViewController {
 
     lazy var scrollView: UIScrollView = {
         let scrollView = UIScrollView()

+ 1 - 1
AIPlayRingtones/AppPage/ASBusinessWebVC/ASBusinessWebVC.swift

@@ -8,7 +8,7 @@
 
 import UIKit
 import WebKit
-class ASBusinessWebVC: TSBaseVC , WKNavigationDelegate {
+class ASBusinessWebVC: ASBaseViewController , WKNavigationDelegate {
     
     enum UrlType:String {
         case privacy = "https://doc-hosting.flycricket.io/ai-ringtones-privacy-policy/ad14f989-96c0-4f31-a711-8db8b288d0e2/privacy"

+ 1 - 1
AIPlayRingtones/AppPage/ASRingGeneratorVC/ASRingGeneratorBaseVC.swift

@@ -5,7 +5,7 @@
 //  Created by 100Years on 2025/5/18.
 //
 
-class ASRingGeneratorBaseVC: TSBaseVC {
+class ASRingGeneratorBaseVC: ASBaseViewController {
     
     lazy var topBgView: UIView = {
         let topBgView = UIView(frame: CGRectMake(0, 0, k_ScreenWidth, k_ScreenHeight))

+ 6 - 1
AIPlayRingtones/AppPage/ASRingGeneratorVC/ASRingGeneratorVC.swift

@@ -4,8 +4,10 @@
 //
 //  Created by 100Years on 2025/5/18.
 //
-
+import Combine
 class ASRingGeneratorVC: ASRingGeneratorBaseVC {
+    public var cancellable: [AnyCancellable] = []
+    
     var infoModel:ASActionInfoModel?
     var complete:((ASActionInfoModel)->Void)?
     var reloadViewBlock:(()->Void)?
@@ -158,6 +160,9 @@ class ASRingGeneratorVC: ASRingGeneratorBaseVC {
 //        if kPurchaseToolShared.kJudgeVipFreeType(vipFreeNumType: .ringtones, vc: self){ return }//判断 vip
     }
 
+    deinit {
+        cancellable.removeAll()
+    }
 }
 
 extension ASRingGeneratorVC{

+ 0 - 173
AIPlayRingtones/Classes/BaseClass/TSBaseNavigationBarView.swift

@@ -1,173 +0,0 @@
-//
-//  TSBaseNavigationBarView.swift
-//  TSLiveWallpaper
-//
-//  Created by 100Years on 2024/12/20.
-//
-
-
-open class TSBaseNavContentBarView: UIView {
-    
-    open lazy var statuView: UIView = {
-       let view = UIView()
-       return view
-   }()
-
-    open lazy var barView: UIView = {
-       let view = UIView()
-       return view
-   }()
-    
-    
-    override init(frame: CGRect) {
-        super.init(frame: frame)
-        
-        addSubview(statuView)
-        addSubview(barView)
-        
-        statuView.snp.makeConstraints { make in
-            make.top.leading.trailing.equalTo(0)
-            make.height.equalTo(k_Height_StatusBar)
-        }
-
-        barView.snp.makeConstraints { make in
-            make.leading.trailing.equalTo(0)
-            make.top.equalTo(k_Height_StatusBar)
-            make.height.equalTo(k_Height_NavBar)
-        }
-
-    }
-    
-    
-    required public init?(coder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-}
-
-open class TSNormalNavigationBarView: TSBaseNavContentBarView {
-
-    // MARK: - Properties
-     var navBgColor: UIColor!
-     var navTitleColor: UIColor!
-     var navTitleFont: UIFont!
-     var navLeftFont: UIFont!
-     var navRightFont: UIFont!
-
-    public lazy var leftNavBtn: UIButton = {
-        let button = createNavButton()
-        button.contentHorizontalAlignment = .left
-        button.contentEdgeInsets = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0)
-        return button
-    }()
-
-    public lazy var titleNavBtn: UIButton = {
-        let button = createNavButton()
-        button.titleLabel?.font = navTitleFont
-        return button
-    }()
-
-    public lazy var rightNavBtn: UIButton = {
-        let button = createNavButton()
-        button.titleLabel?.font = navRightFont
-        button.titleLabel?.adjustsFontSizeToFitWidth = true
-        button.contentHorizontalAlignment = .right
-        button.setTitleColor(.themeColor, for: .normal)
-        button.contentEdgeInsets = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0)
-        return button
-    }()
-
-    // MARK: - Initializers
-    override init(frame: CGRect) {
-        super.init(frame: frame)
-        createData()
-        createView()
-    }
-    
-    @MainActor required public init?(coder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-    
-
-    // MARK: - Setup Methods
-    private func createData() {
-        navBgColor = .clear
-        navTitleColor = "#0E1550".uiColor
-        navTitleFont = .font(size: 18,weight:.medium)
-        navLeftFont = .font(size: 16,weight:.medium)
-        navRightFont = .font(size: 16,weight:.medium)
-    }
-
-    private func createView() {
-//        let space: CGFloat = 10
-        let margins: CGFloat = 16
-
-        backgroundColor = navBgColor
-
-  
-        barView.addSubview(leftNavBtn)
-        barView.addSubview(titleNavBtn)
-        barView.addSubview(rightNavBtn)
-
-        leftNavBtn.snp.makeConstraints { make in
-            make.leading.equalTo(margins)
-            make.centerY.equalToSuperview()
-            make.width.height.equalTo(44.0)
-        }
-        
-        rightNavBtn.snp.makeConstraints { make in
-            make.trailing.equalTo(-margins)
-            make.centerY.equalToSuperview()
-            make.width.height.equalTo(44.0)
-        }
-        
-         titleNavBtn.snp.makeConstraints { make in
-             make.leading.equalTo(leftNavBtn.snp.trailing).offset(margins)
-             make.trailing.equalTo(rightNavBtn.snp.leading).offset(-margins)
-             make.centerY.equalToSuperview()
-             make.height.equalTo(44.0)
-         }
-         
-    }
-
-    // MARK: - Helper Methods
-    public func setTitleName(_ name: String) -> UIButton {
-        titleNavBtn.setTitle(name, for: .normal)
-        return titleNavBtn
-    }
-
-    public func setTitleNavigationItem(name: String, imageName: String, target: Any?, action: Selector) -> UIButton {
-        setNavButton(button: titleNavBtn, name: name, imageName: imageName, target: target, action: action)
-        return titleNavBtn
-    }
-
-    public func setLeftNavigationItem(name: String, imageName: String, target: Any?, action: Selector) -> UIButton {
-        setNavButton(button: leftNavBtn, name: name, imageName: imageName, target: target, action: action)
-        return leftNavBtn
-    }
-
-    public func setRightNavigationItem(name: String, imageName: String, target: Any?, action: Selector) -> UIButton {
-        setNavButton(button: rightNavBtn, name: name, imageName: imageName, target: target, action: action)
-        return rightNavBtn
-    }
-
-    public func setNavButton(button: UIButton, name: String, imageName: String, target: Any?, action: Selector) {
-        button.setTitle(name, for: .normal)
-        
-        if imageName.count > 0 {
-            let image = UIImage(named: imageName)?.withRenderingMode(.alwaysOriginal)
-            if let image = image {
-                button.setImage(image, for: .normal)
-            }
-        }
-
-        button.addTarget(target, action: action, for: .touchUpInside)
-    }
-
-    public func createNavButton() -> UIButton {
-        let button = UIButton()
-        button.setTitleColor(navTitleColor, for: .normal)
-        button.titleLabel?.font = navRightFont
-        button.titleLabel?.adjustsFontSizeToFitWidth = true
-        return button
-    }
-}

+ 0 - 153
AIPlayRingtones/Classes/BaseClass/TSBaseVC.swift

@@ -1,153 +0,0 @@
-//
-//  TSBaseVC.swift
-//  TSLiveWallpaper
-//
-//  Created by 100Years on 2024/12/20.
-//
-
-import UIKit
-import Combine
-
-open class TSBaseVC: UIViewController {
-
-    public var cancellable: [AnyCancellable] = []
-
-    public lazy var contentView: UIView = {
-        let view = UIView()
-        return view
-    }()
-    
-    
-    public lazy var navBarContentView: UIView = {
-        let view = UIView()
-        view.backgroundColor = .clear
-        return view
-    }()
-    
-    public lazy var normalNavBarView: TSNormalNavigationBarView = {
-        let view = TSNormalNavigationBarView()
-        return view
-    }()
-    
-    required public init?(coder: NSCoder) {
-        super.init(coder: coder)
-    }
-
-    /// 提供一个无参数的默认初始化方法
-    public init() {
-        super.init(nibName: nil, bundle: nil)
-    }
-    
-    open override func viewDidLoad() {
-        super.viewDidLoad()
-        setupSuperSomeView()
-        createData()
-        createView()
-        dealThings()
-    }
-    
-    private func setupSuperSomeView() {
-        edgesForExtendedLayout = [.all]
-        
-        view.addSubview(contentView)
-        view.addSubview(navBarContentView)
-        
-        contentView.snp.makeConstraints { make in
-            make.top.equalTo(k_Nav_Height)
-            make.leading.trailing.bottom.equalToSuperview()
-        }
-        
-        navBarContentView.snp.makeConstraints { make in
-            make.leading.top.trailing.equalToSuperview()
-            make.height.equalTo(k_Nav_Height)
-        }
-
-        view.backgroundColor = .mainBg
-        view.layoutIfNeeded()
-    }
-    
-    //子类重写
-    open func createData(){
-        
-        
-    }
-    open func createView(){
-        
-        
-    }
-    
-    open func dealThings(){
-        
-        
-    }
-    
-
-    public func addNormalNavBarView(){
-        navBarContentView.addSubview(normalNavBarView)
-        normalNavBarView.snp.makeConstraints { make in
-            make.edges.equalToSuperview()
-        }
-    }
-
-
-    open override func viewWillAppear(_ animated: Bool) {
-        debugPrint("进入------>\(String(describing: type(of: self)))")
-    }
-
-    deinit {
-        NotificationCenter.default.removeObserver(self)
-        cancellable.removeAll()
-        debugPrint("♻️♻️♻️ TGRootViewController -> \(type(of: self)) deinit ♻️♻️♻️")
-    }
-
-    // MARK: - 导航栏方法
-
-    public func setTitleText(_ title: String) {
-       _ = normalNavBarView.setTitleName(NSLocalizedString(title, comment: ""))
-    }
-
-    public func setPageTitle(_ title: String) {
-        let pageTitle = title
-        let backTitle = " "
-        setTitleText(pageTitle)
-        _ = setNavigationItem(backTitle, imageName: "navi_back_white", direction: .left, action: #selector(navBarClickLeftAction))
-    }
-
-    public func setNavigationItem(_ name: String, imageName: String, direction: NSTextAlignment, action: Selector) -> UIButton {
-        if direction == .left {
-            return normalNavBarView.setLeftNavigationItem(name: name, imageName: imageName, target: self, action: action)
-        } else {
-            return normalNavBarView.setRightNavigationItem(name: name, imageName: imageName, target: self, action: action)
-        }
-    }
-
-    @objc open func navBarClickLeftAction() {
-        debugPrint("navBarClickLeftAction -> \(type(of: self))")
-        pop()
-    }
-
-    public func pop() {
-        if navigationController == nil {
-            dismiss(animated: true, completion: nil)
-        } else if navigationController?.presentingViewController != nil, navigationController?.viewControllers.count == 1 {
-            navigationController?.dismiss(animated: true, completion: nil)
-        } else {
-            navigationController?.popViewController(animated: true)
-        }
-    }
-
-    public func setNavBarViewHidden(_ isHidden: Bool) {
-        navBarContentView.snp.updateConstraints { make in
-            make.height.equalTo(isHidden ? 0 : k_Nav_Height)
-        }
-        
-        contentView.snp.updateConstraints { make in
-            make.top.equalTo(isHidden ? 0 : k_Nav_Height)
-        }
-    }
-    
-    public var isViewVisible: Bool {
-        return isViewLoaded && view.window != nil && presentedViewController == nil
-    }
-    
-}

+ 0 - 152
AIPlayRingtones/Classes/BaseClass/TSBasicItemModel.swift

@@ -1,152 +0,0 @@
-//
-//  TSBasicItemModel.swift
-//  TSLiveWallpaper
-//
-//  Created by 100Years on 2024/12/20.
-//
-
-open class TSBasicItemModel {
-    // MARK: - Properties
-    public var index: Int = 0
-//    var clickBlock: ((Any?) -> Void)?
-    public var tapBlock: ((TSBasicItemModel, Int, Any?) -> Void)?
-    public var updateDataBlock: ((TSBasicItemModel) -> Void)?
-    
-    public var leftImageName: String?
-    public var leftImage: UIImage?
-    public var leftImagePath: String?
-    public var leftTitle: String?
-    public var leftSubTitle: String?
-    public var rightString: String?
-    public  var rightSubString: String?
-    public var rightIntValue: Int = 0
-    public var itemData: Any?
-    public var identifier: String?
-    public var parametView: UIView?
-    public var rightIsHave: Bool = false
-    public var bottomIsHave: Bool = false
-    public var isSelected: Bool = false
-    public var isWhether: Bool = false
-    public var rightViewStyle: Int = 0
-    public var rectCorner: UIRectCorner = []
-    public var topSpace: Bool = false
-    public var bottomSpace: Bool = false
-    public var height: CGFloat = 0.0
-    public var width: CGFloat = 0.0
-    public var type: Int = 0
-    public weak var attributionSection: TSBasicSectionModel?
-    
-    public init() {
-        
-    }
-    
-    // MARK: - Methods
-    public func setCornerView(_ view: UIView, corner: CGFloat) {
-        if rectCorner.rawValue == 0 || rectCorner.isEmpty {
-            view.layer.cornerRadius = 0
-        } else {
-            let path = UIBezierPath(roundedRect: view.bounds, byRoundingCorners: rectCorner, cornerRadii: CGSize(width: corner, height: corner))
-            let mask = CAShapeLayer()
-            mask.path = path.cgPath
-            view.layer.mask = mask
-        }
-    }
-    
-    public func updateData() {
-        updateDataBlock?(self)
-    }
-    
-    
-    public static func createItemModel(leftTitle: String,
-                                rightViewStyle: Int,
-                                rightString: String,
-                                rightIsHave: Bool,
-                                height: CGFloat,
-                                rectCorner: UIRectCorner,
-                                tapBlock: @escaping ((TSBasicItemModel, Int, Any?) -> Void)) -> TSBasicItemModel {
-        let model = TSBasicItemModel()
-        model.leftTitle = leftTitle
-        model.rightViewStyle = rightViewStyle
-        model.rightString = rightString
-        model.rightIsHave = rightIsHave
-        model.height = height
-        model.rectCorner = rectCorner
-        model.tapBlock = tapBlock
-        return model
-    }
-    
-    
-    public static func setEdge(with dataArray: [TSBasicItemModel]) {
-        guard !dataArray.isEmpty else { return }
-        if dataArray.count == 1 {
-            dataArray.first?.rectCorner = .allCorners
-        } else {
-            dataArray.first?.rectCorner = [.topLeft, .topRight]
-            dataArray.last?.rectCorner = [.bottomLeft, .bottomRight]
-        }
-    }
-}
-
-
-
-open class TSBasicSectionModel {
-    // MARK: - Properties
-    open var index: Int = 0
-    open var sectionData: Any?
-    open var leftTitle: String?
-    open var leftSubTitle: String?
-    open var rightString: String?
-    open var rightSubString: String?
-    open var rightIsHave: Bool = false
-    open var bottomIsHave: Bool = false
-    open var topIsHave: Bool = false
-    open var isOpen: Bool = false
-    open var type: Int = 0
-    open var rectCorner: UIRectCorner = []
-    open var height: CGFloat = 0.0
-    open var isFooter: Bool = false
-    open var itemsArray: [TSBasicItemModel] = []
-    open var selectedItemsIndex: Int = 0
-    
-    public init() {
-        
-    }
-    
-    // MARK: - Methods
-    public func setCornerView(_ view: UIView, corner: CGFloat) {
-        if rectCorner.rawValue == 0 || rectCorner.isEmpty {
-            view.layer.cornerRadius = 0
-        } else {
-            let path = UIBezierPath(roundedRect: view.bounds, byRoundingCorners: rectCorner, cornerRadii: CGSize(width: corner, height: corner))
-            let mask = CAShapeLayer()
-            mask.path = path.cgPath
-            view.layer.mask = mask
-        }
-    }
-    
-    public func addSubItemModel(_ itemModel: TSBasicItemModel) {
-        itemModel.attributionSection = self
-        itemsArray.append(itemModel)
-    }
-    
-    public static func createSectionModel(leftTitle: String, height: CGFloat, index: Int = 0) -> TSBasicSectionModel {
-        let model = TSBasicSectionModel()
-        model.leftTitle = leftTitle
-        model.height = height
-        model.index = index
-        return model
-    }
-    
-    public static func setEdge(with dataArray: [TSBasicSectionModel]) {
-        for section in dataArray {
-            let itemsArray = section.itemsArray
-            guard !itemsArray.isEmpty else { continue }
-            if itemsArray.count == 1 {
-                itemsArray.first?.rectCorner = .allCorners
-            } else {
-                itemsArray.first?.rectCorner = [.topLeft, .topRight]
-                itemsArray.last?.rectCorner = [.bottomLeft, .bottomRight]
-            }
-        }
-    }
-}

+ 1 - 1
AIPlayRingtones/Classes/GlobalImports/GlobalMacros.h

@@ -58,6 +58,6 @@ static inline BOOL isIphoneX() {
     return k_Height_safeAreaInsetsBottom() > 0.0;
 }
 
-
+#define k_Height_StatusBar k_Height_statusBar()
 
 #endif /* GlobalMacros_h */

+ 33 - 0
AIPlayRingtones/Common/BaseClass/ASBaseViewController.h

@@ -0,0 +1,33 @@
+//
+//  ASBaseViewController.h
+//  AIPlayRingtones
+//
+//  Created by mini on 2025/5/27.
+//
+
+#import <UIKit/UIKit.h>
+#import "ASNormalNavigationBarView.h"
+NS_ASSUME_NONNULL_BEGIN
+
+@interface ASBaseViewController : UIViewController
+
+@property (nonatomic, strong) UIView *contentView;
+@property (nonatomic, strong) UIView *navBarContentView;
+@property (nonatomic, strong) ASNormalNavigationBarView *normalNavBarView;
+
+- (instancetype)init;
+- (void)createData;
+- (void)createView;
+- (void)dealThings;
+- (void)addNormalNavBarView;
+- (void)setTitleText:(NSString *)title;
+- (void)setPageTitle:(NSString *)title;
+- (UIButton *)setNavigationItem:(NSString *)name imageName:(NSString *)imageName direction:(NSTextAlignment)direction action:(SEL)action;
+- (void)navBarClickLeftAction;
+- (void)pop;
+- (void)setNavBarViewHidden:(BOOL)isHidden;
+@property (nonatomic, readonly) BOOL isViewVisible;
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 128 - 0
AIPlayRingtones/Common/BaseClass/ASBaseViewController.m

@@ -0,0 +1,128 @@
+//
+//  ASBaseViewController.m
+//  AIPlayRingtones
+//
+//  Created by mini on 2025/5/27.
+//
+
+#import "ASBaseViewController.h"
+#import "Masonry.h"
+#import "GlobalMacros.h"
+#import "NSString+AS.h"
+@interface ASBaseViewController ()
+
+@end
+
+@implementation ASBaseViewController
+
+- (instancetype)init {
+    self = [super initWithNibName:nil bundle:nil];
+    if (self) {
+
+    }
+    return self;
+}
+
+- (void)viewDidLoad {
+    [super viewDidLoad];
+    [self setupSuperSomeView];
+    [self createData];
+    [self createView];
+    [self dealThings];
+}
+
+- (void)setupSuperSomeView {
+    self.edgesForExtendedLayout = UIRectEdgeAll;
+    
+    _contentView = [[UIView alloc] init];
+    _navBarContentView = [[UIView alloc] init];
+    _navBarContentView.backgroundColor = [UIColor clearColor];
+    
+    [self.view addSubview:_contentView];
+    [self.view addSubview:_navBarContentView];
+    
+    [_contentView mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.top.equalTo(@(k_Nav_Height));
+        make.leading.trailing.bottom.equalTo(self.view);
+    }];
+    
+    [_navBarContentView mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.leading.top.trailing.equalTo(self.view);
+        make.height.equalTo(@(k_Nav_Height));
+    }];
+    
+    self.view.backgroundColor = @"#111018".uiColor;
+    [self.view layoutIfNeeded];
+}
+
+- (void)createData {}
+- (void)createView {}
+- (void)dealThings {}
+
+- (void)addNormalNavBarView {
+    _normalNavBarView = [[ASNormalNavigationBarView alloc] init];
+    [_navBarContentView addSubview:_normalNavBarView];
+    [_normalNavBarView mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.edges.equalTo(_navBarContentView);
+    }];
+}
+
+- (void)viewWillAppear:(BOOL)animated {
+    NSLog(@"进入------>%@", NSStringFromClass([self class]));
+}
+
+- (void)dealloc {
+    [[NSNotificationCenter defaultCenter] removeObserver:self];
+    NSLog(@"♻️♻️♻️ ASBaseViewController -> %@ deinit ♻️♻️♻️", NSStringFromClass([self class]));
+}
+
+#pragma mark - 导航栏方法
+
+- (void)setTitleText:(NSString *)title {
+    [_normalNavBarView setTitleName:NSLocalizedString(title, @"")];
+}
+
+- (void)setPageTitle:(NSString *)title {
+    NSString *pageTitle = title;
+    NSString *backTitle = @" ";
+    [self setTitleText:pageTitle];
+    [self setNavigationItem:backTitle imageName:@"navi_back_white" direction:NSTextAlignmentLeft action:@selector(navBarClickLeftAction)];
+}
+
+- (UIButton *)setNavigationItem:(NSString *)name imageName:(NSString *)imageName direction:(NSTextAlignment)direction action:(SEL)action {
+    if (direction == NSTextAlignmentLeft) {
+        return [_normalNavBarView setLeftNavigationItemWithName:name imageName:imageName target:self action:action];
+    } else {
+        return [_normalNavBarView setRightNavigationItemWithName:name imageName:imageName target:self action:action];
+    }
+}
+
+- (void)navBarClickLeftAction {
+    NSLog(@"navBarClickLeftAction -> %@", NSStringFromClass([self class]));
+    [self pop];
+}
+
+- (void)pop {
+    if (self.navigationController == nil) {
+        [self dismissViewControllerAnimated:YES completion:nil];
+    } else if (self.navigationController.presentingViewController != nil && self.navigationController.viewControllers.count == 1) {
+        [self.navigationController dismissViewControllerAnimated:YES completion:nil];
+    } else {
+        [self.navigationController popViewControllerAnimated:YES];
+    }
+}
+
+- (void)setNavBarViewHidden:(BOOL)isHidden {
+    [_navBarContentView mas_updateConstraints:^(MASConstraintMaker *make) {
+        make.height.equalTo(@(isHidden ? 0 : k_Nav_Height));
+    }];
+    
+    [_contentView mas_updateConstraints:^(MASConstraintMaker *make) {
+        make.top.equalTo(@(isHidden ? 0 : k_Nav_Height));
+    }];
+}
+
+- (BOOL)isViewVisible {
+    return self.isViewLoaded && self.view.window != nil && self.presentedViewController == nil;
+}
+@end

+ 1 - 1
AIPlayRingtones/Common/BaseClass/ASNormalNavigationBarView.m

@@ -23,7 +23,7 @@
 
 - (void)createData {
     self.navBgColor = [UIColor clearColor];
-    self.navTitleColor = @"#0E1550".uiColor;
+    self.navTitleColor = [UIColor whiteColor];
     self.navTitleFont = [UIFont systemFontOfSize:18 weight:UIFontWeightMedium];
     self.navLeftFont = [UIFont systemFontOfSize:16 weight:UIFontWeightMedium];
     self.navRightFont = [UIFont systemFontOfSize:16 weight:UIFontWeightMedium];