瀏覽代碼

4.3a改造:重写了tabbar

kln 1 周之前
父節點
當前提交
7b3f378e9f

+ 58 - 8
AIPlayRingtones.xcodeproj/project.pbxproj

@@ -59,6 +59,12 @@
 		3DBEA10B2DE69B2E000C6859 /* TSCollectionViewObserver.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3DBEA0A72DE69B2E000C6859 /* TSCollectionViewObserver.swift */; };
 		3DBEA1102DE6A04B000C6859 /* SimpleWebViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3DBEA10F2DE6A04B000C6859 /* SimpleWebViewController.m */; };
 		3DBEA1122DE6A3AA000C6859 /* TopLeftLabel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3DBEA1112DE6A3A6000C6859 /* TopLeftLabel.swift */; };
+		3DBEA11A2DE6B086000C6859 /* CustomTabBarController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3DBEA1192DE6B086000C6859 /* CustomTabBarController.m */; };
+		3DBEA11E2DE6B229000C6859 /* NSString+AS.m in Sources */ = {isa = PBXBuildFile; fileRef = 3DBEA11D2DE6B229000C6859 /* NSString+AS.m */; };
+		3DBEA1252DE6B36D000C6859 /* UIColor+AS.m in Sources */ = {isa = PBXBuildFile; fileRef = 3DBEA1242DE6B36D000C6859 /* UIColor+AS.m */; };
+		3DBEA1272DE6BA99000C6859 /* GlobalImportsOC.h in Sources */ = {isa = PBXBuildFile; fileRef = 3DBEA1262DE6BA96000C6859 /* GlobalImportsOC.h */; };
+		3DBEA12B2DE6BCE3000C6859 /* ASBaseNavigationController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3DBEA12A2DE6BCE3000C6859 /* ASBaseNavigationController.m */; };
+		3DBEA12E2DE6BF19000C6859 /* ASBaseView.m in Sources */ = {isa = PBXBuildFile; fileRef = 3DBEA12D2DE6BF19000C6859 /* ASBaseView.m */; };
 		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 */; };
@@ -103,7 +109,6 @@
 		A848F8A92DD6D74A00B746EC /* APAudioToRingVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = A848F8A82DD6D74900B746EC /* APAudioToRingVC.swift */; };
 		A848F8AB2DD6D75300B746EC /* ASMyRingVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = A848F8AA2DD6D75200B746EC /* ASMyRingVC.swift */; };
 		A848F8AD2DD6D75900B746EC /* APSettingVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = A848F8AC2DD6D75800B746EC /* APSettingVC.swift */; };
-		A848F8B02DD6D77C00B746EC /* ASTabBarVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = A848F8AF2DD6D77B00B746EC /* ASTabBarVC.swift */; };
 		A848F8B32DD6D82300B746EC /* APConfig.swift in Sources */ = {isa = PBXBuildFile; fileRef = A848F8B22DD6D82300B746EC /* APConfig.swift */; };
 		A848F8B52DD6D83E00B746EC /* APConfig+Color.swift in Sources */ = {isa = PBXBuildFile; fileRef = A848F8B42DD6D82E00B746EC /* APConfig+Color.swift */; };
 		A848F8B92DD6DF7900B746EC /* ASAppBtnView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A848F8B82DD6DF7700B746EC /* ASAppBtnView.swift */; };
@@ -188,6 +193,17 @@
 		3DBEA10E2DE6A04B000C6859 /* SimpleWebViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SimpleWebViewController.h; sourceTree = "<group>"; };
 		3DBEA10F2DE6A04B000C6859 /* SimpleWebViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SimpleWebViewController.m; sourceTree = "<group>"; };
 		3DBEA1112DE6A3A6000C6859 /* TopLeftLabel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TopLeftLabel.swift; sourceTree = "<group>"; };
+		3DBEA1182DE6B086000C6859 /* CustomTabBarController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CustomTabBarController.h; sourceTree = "<group>"; };
+		3DBEA1192DE6B086000C6859 /* CustomTabBarController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CustomTabBarController.m; sourceTree = "<group>"; };
+		3DBEA11C2DE6B229000C6859 /* NSString+AS.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NSString+AS.h"; sourceTree = "<group>"; };
+		3DBEA11D2DE6B229000C6859 /* NSString+AS.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "NSString+AS.m"; sourceTree = "<group>"; };
+		3DBEA1232DE6B36D000C6859 /* UIColor+AS.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "UIColor+AS.h"; sourceTree = "<group>"; };
+		3DBEA1242DE6B36D000C6859 /* UIColor+AS.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "UIColor+AS.m"; sourceTree = "<group>"; };
+		3DBEA1262DE6BA96000C6859 /* GlobalImportsOC.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GlobalImportsOC.h; sourceTree = "<group>"; };
+		3DBEA1292DE6BCE3000C6859 /* ASBaseNavigationController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ASBaseNavigationController.h; sourceTree = "<group>"; };
+		3DBEA12A2DE6BCE3000C6859 /* ASBaseNavigationController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ASBaseNavigationController.m; sourceTree = "<group>"; };
+		3DBEA12C2DE6BF19000C6859 /* ASBaseView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ASBaseView.h; sourceTree = "<group>"; };
+		3DBEA12D2DE6BF19000C6859 /* ASBaseView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ASBaseView.m; 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>"; };
@@ -239,7 +255,6 @@
 		A848F8A82DD6D74900B746EC /* APAudioToRingVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = APAudioToRingVC.swift; sourceTree = "<group>"; };
 		A848F8AA2DD6D75200B746EC /* ASMyRingVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ASMyRingVC.swift; sourceTree = "<group>"; };
 		A848F8AC2DD6D75800B746EC /* APSettingVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = APSettingVC.swift; sourceTree = "<group>"; };
-		A848F8AF2DD6D77B00B746EC /* ASTabBarVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ASTabBarVC.swift; sourceTree = "<group>"; };
 		A848F8B22DD6D82300B746EC /* APConfig.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = APConfig.swift; sourceTree = "<group>"; };
 		A848F8B42DD6D82E00B746EC /* APConfig+Color.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "APConfig+Color.swift"; sourceTree = "<group>"; };
 		A848F8B82DD6DF7700B746EC /* ASAppBtnView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ASAppBtnView.swift; sourceTree = "<group>"; };
@@ -336,6 +351,10 @@
 				3DBEA0782DE69B2E000C6859 /* TSBaseView.swift */,
 				3DBEA0792DE69B2E000C6859 /* TSBaseViewModel.swift */,
 				3DBEA07A2DE69B2E000C6859 /* TSBasicItemModel.swift */,
+				3DBEA1292DE6BCE3000C6859 /* ASBaseNavigationController.h */,
+				3DBEA12A2DE6BCE3000C6859 /* ASBaseNavigationController.m */,
+				3DBEA12C2DE6BF19000C6859 /* ASBaseView.h */,
+				3DBEA12D2DE6BF19000C6859 /* ASBaseView.m */,
 			);
 			path = BaseClass;
 			sourceTree = "<group>";
@@ -360,6 +379,8 @@
 		3DBEA09B2DE69B2E000C6859 /* Ex */ = {
 			isa = PBXGroup;
 			children = (
+				3DBEA1282DE6BC3E000C6859 /* Base class */,
+				3DBEA11B2DE6B1F3000C6859 /* OC */,
 				3DBEA0822DE69B2E000C6859 /* SwiftUI */,
 				3DBEA0832DE69B2E000C6859 /* Array+Ex.swift */,
 				3DBEA0862DE69B2E000C6859 /* CGFloat+Ex.swift */,
@@ -382,6 +403,7 @@
 		3DBEA09D2DE69B2E000C6859 /* GlobalImports */ = {
 			isa = PBXGroup;
 			children = (
+				3DBEA1262DE6BA96000C6859 /* GlobalImportsOC.h */,
 				3DBEA09C2DE69B2E000C6859 /* GlobalImports.swift */,
 			);
 			path = GlobalImports;
@@ -466,6 +488,33 @@
 			path = SimpleWebViewController;
 			sourceTree = "<group>";
 		};
+		3DBEA1132DE6B037000C6859 /* CustomTabBarController */ = {
+			isa = PBXGroup;
+			children = (
+				3DBEA1182DE6B086000C6859 /* CustomTabBarController.h */,
+				3DBEA1192DE6B086000C6859 /* CustomTabBarController.m */,
+			);
+			path = CustomTabBarController;
+			sourceTree = "<group>";
+		};
+		3DBEA11B2DE6B1F3000C6859 /* OC */ = {
+			isa = PBXGroup;
+			children = (
+				3DBEA11C2DE6B229000C6859 /* NSString+AS.h */,
+				3DBEA11D2DE6B229000C6859 /* NSString+AS.m */,
+				3DBEA1232DE6B36D000C6859 /* UIColor+AS.h */,
+				3DBEA1242DE6B36D000C6859 /* UIColor+AS.m */,
+			);
+			path = OC;
+			sourceTree = "<group>";
+		};
+		3DBEA1282DE6BC3E000C6859 /* Base class */ = {
+			isa = PBXGroup;
+			children = (
+			);
+			path = "Base class";
+			sourceTree = "<group>";
+		};
 		3DCD56F82DDAE481004AAB5B /* TSAudioPlayer */ = {
 			isa = PBXGroup;
 			children = (
@@ -611,6 +660,7 @@
 		A848F88B2DD6D2C600B746EC /* AppPage */ = {
 			isa = PBXGroup;
 			children = (
+				3DBEA1132DE6B037000C6859 /* CustomTabBarController */,
 				3DBEA10D2DE6A02F000C6859 /* SimpleWebViewController */,
 				3DB4D4A62DDC924B0082596A /* ASBusinessWebVC */,
 				A848F8B62DD6DF5500B746EC /* ASCommonView */,
@@ -703,7 +753,6 @@
 		A848F8AE2DD6D76F00B746EC /* ASTabBarVC */ = {
 			isa = PBXGroup;
 			children = (
-				A848F8AF2DD6D77B00B746EC /* ASTabBarVC.swift */,
 			);
 			path = ASTabBarVC;
 			sourceTree = "<group>";
@@ -950,14 +999,10 @@
 			inputFileListPaths = (
 				"${PODS_ROOT}/Target Support Files/Pods-AIPlayRingtones/Pods-AIPlayRingtones-frameworks-${CONFIGURATION}-input-files.xcfilelist",
 			);
-			inputPaths = (
-			);
 			name = "[CP] Embed Pods Frameworks";
 			outputFileListPaths = (
 				"${PODS_ROOT}/Target Support Files/Pods-AIPlayRingtones/Pods-AIPlayRingtones-frameworks-${CONFIGURATION}-output-files.xcfilelist",
 			);
-			outputPaths = (
-			);
 			runOnlyForDeploymentPostprocessing = 0;
 			shellPath = /bin/sh;
 			shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-AIPlayRingtones/Pods-AIPlayRingtones-frameworks.sh\"\n";
@@ -986,6 +1031,7 @@
 				A848F8E32DD7286A00B746EC /* ASGenerateStyleModel.swift in Sources */,
 				3DCD57052DDB1120004AAB5B /* TSPurchaseTool.swift in Sources */,
 				3DB4D4992DDC28E70082596A /* APAudioToRingVC+StackView.swift in Sources */,
+				3DBEA11E2DE6B229000C6859 /* NSString+AS.m in Sources */,
 				3DCD56F52DDAE42A004AAB5B /* ASViewTool.swift in Sources */,
 				3DB4D4972DDC28D40082596A /* APAudioToRingVC+View.swift in Sources */,
 				A800FEBD2DDACCD4009DABDC /* ASRingGeneratorBaseVC.swift in Sources */,
@@ -999,7 +1045,7 @@
 				3DCD57312DDB2A66004AAB5B /* ASGenerateRingToRingOperation.swift in Sources */,
 				A848F8EA2DD74E3A00B746EC /* ASDBActionInfoModel.swift in Sources */,
 				3DCD573D2DDB5A3C004AAB5B /* ASMyRingCell.swift in Sources */,
-				A848F8B02DD6D77C00B746EC /* ASTabBarVC.swift in Sources */,
+				3DBEA11A2DE6B086000C6859 /* CustomTabBarController.m in Sources */,
 				A848F8B32DD6D82300B746EC /* APConfig.swift in Sources */,
 				A848F8FC2DD753A000B746EC /* ASProgressState.swift in Sources */,
 				A848F8A92DD6D74A00B746EC /* APAudioToRingVC.swift in Sources */,
@@ -1021,6 +1067,7 @@
 				A848F8F32DD7528D00B746EC /* ASBaseOperation.swift in Sources */,
 				A848F8BB2DD6E30600B746EC /* APRingTonesVM.swift in Sources */,
 				3DB4D49B2DDC28F20082596A /* APAudioToRingVC+Upload.swift in Sources */,
+				3DBEA1272DE6BA99000C6859 /* GlobalImportsOC.h in Sources */,
 				3DB4D4B22DDF0B960082596A /* FakeBlurView.swift in Sources */,
 				3DCD56F32DDAE3E3004AAB5B /* ASRingToneCellView.swift in Sources */,
 				3DCD56FF2DDAFC1B004AAB5B /* ASBusinessFileManager.swift in Sources */,
@@ -1037,6 +1084,7 @@
 				3DCD56FD2DDAFBE5004AAB5B /* ASDownloadManager.swift in Sources */,
 				3DCD573B2DDB4E61004AAB5B /* ASPageNullView.swift in Sources */,
 				A848F8F12DD7528800B746EC /* ASBaseOperationQueue.swift in Sources */,
+				3DBEA12E2DE6BF19000C6859 /* ASBaseView.m in Sources */,
 				A848F8CD2DD6EAD300B746EC /* ASPromptTextView.swift in Sources */,
 				A848F8DB2DD7231E00B746EC /* APRingStyleVC.swift in Sources */,
 				A848F8D22DD7149D00B746EC /* ASDurationColView.swift in Sources */,
@@ -1057,6 +1105,7 @@
 				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 */,
 				3DBEA0EC2DE69B2E000C6859 /* UILabel+Ex.swift in Sources */,
 				3DBEA0ED2DE69B2E000C6859 /* TSBaseCollectionCell.swift in Sources */,
@@ -1074,6 +1123,7 @@
 				3DBEA1002DE69B2E000C6859 /* UIViewController+Ex.swift in Sources */,
 				3DBEA1012DE69B2E000C6859 /* Date+Ex.swift in Sources */,
 				3DBEA1032DE69B2E000C6859 /* NSString+Ex.swift in Sources */,
+				3DBEA1252DE6B36D000C6859 /* UIColor+AS.m in Sources */,
 				3DBEA1062DE69B2E000C6859 /* GlobalImports.swift in Sources */,
 				3DBEA1072DE69B2E000C6859 /* TSPlaceholderTextView.swift in Sources */,
 				3DBEA1082DE69B2E000C6859 /* UIView+Frame.swift in Sources */,

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

@@ -7,3 +7,4 @@
 
 #import "ExtAudioConverter.h"
 #import "AudioConverter.h"
+#import "CustomTabBarController.h"

+ 1 - 1
AIPlayRingtones/AppDelegate.swift

@@ -32,7 +32,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
     }
     
     func goToTab() {
-        window?.rootViewController = ASTabBarVC()
+        window?.rootViewController = CustomTabBarController()
     }
 
     func JudgmentSkipPage() {

+ 0 - 88
AIPlayRingtones/AppPage/ASTabBarVC/ASTabBarVC.swift

@@ -1,88 +0,0 @@
-//
-//  ASTabBarVC.swift
-//  AIPlayRingtones
-//
-//  Created by 100Years on 2025/5/15.
-//
-
-
-import UIKit
-class ASTabBarVC: UITabBarController {
-  
-    private var viewControllerArray: [UIViewController] = []
-    private var titleArray: [String] = []
-    private var selectedImageArray: [String] = []
-    private var unselectedImageArray: [String] = []
-    
-    private var interceptVC: UINavigationController = UINavigationController()
-    
-    override func viewDidLoad() {
-        super.viewDidLoad()
-        createUI()
-        setUpData()
-    }
-
-    @objc private func setUpData() {
-        viewControllerArray = [APAudioToRingVC(),
-                               APRingTonesVC(),
-                               APMyRingVC(),
-                               APSettingVC()]
-
-        titleArray = ["Create","Audio","Mine","Setting"]
-        selectedImageArray = [
-            "tabbar_selected_audio",
-            "tabbar_selected_create",
-            "tabbar_selected_mine",
-            "tabbar_selected_setting"
-        ]
-        unselectedImageArray = [
-            "tabbar_unSelect_audio",
-            "tabbar_unSelect_create",
-            "tabbar_unSelect_mine",
-            "tabbar_unSelect_setting"
-        ]
-
-        var tabArray: [UINavigationController] = []
-
-        for i in 0..<viewControllerArray.count {
-            let nav = TSBaseNavigationC(rootViewController: viewControllerArray[i])
-            nav.view.backgroundColor = UIColor.black
-            nav.tabBarItem = tabBarItem(
-                title: titleArray[i].localized,
-                image: UIImage(named: unselectedImageArray[i]),
-                selectedImage: UIImage(named: selectedImageArray[i]),
-                tag: i
-            )
-            tabArray.append(nav)
-        }
-
-        self.viewControllers = tabArray
-        interceptVC = tabArray.last!
-    }
-
-    private func createUI() {
-        tabBar.barStyle = .black
-        tabBar.isTranslucent = false
-        tabBar.backgroundColor = "#1E1D29".uiColor
-        tabBar.backgroundImage = UIImage.colorFrom(color: tabBar.backgroundColor!, size: CGSize(width: k_ScreenWidth, height: k_TabBar_Height))
-        
-        UITabBar.appearance().unselectedItemTintColor = .white.withAlphaComponent(0.4)
-        UITabBar.appearance().tintColor = UIColor.white
-
-    }
-
-    private func tabBarItem(title: String, image: UIImage?, selectedImage: UIImage?, tag: Int) -> UITabBarItem {
-        let tabBarItem = UITabBarItem()
-        tabBarItem.image = image?.withRenderingMode(.alwaysOriginal)
-        tabBarItem.title = title
-        tabBarItem.selectedImage = selectedImage?.withRenderingMode(.alwaysOriginal)
-        return tabBarItem
-    }
-
-    deinit {
-        debugPrint("ASTabBarVC deinit")
-        NotificationCenter.default.removeObserver(self)
-    }
-    
-
-}

+ 16 - 0
AIPlayRingtones/AppPage/CustomTabBarController/CustomTabBarController.h

@@ -0,0 +1,16 @@
+//
+//  CustomTabBarController.h
+//  AIPlayRingtones
+//
+//  Created by mini on 2025/5/27.
+//
+
+#import <UIKit/UIKit.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface CustomTabBarController : UITabBarController
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 73 - 0
AIPlayRingtones/AppPage/CustomTabBarController/CustomTabBarController.m

@@ -0,0 +1,73 @@
+//
+//  CustomTabBarController.m
+//  AIPlayRingtones
+//
+//  Created by mini on 2025/5/27.
+//
+#import "AIPlayRingtones-Swift.h"
+#import "CustomTabBarController.h"
+#import "NSString+AS.h"
+#import "UIColor+AS.h"
+#import "GlobalImportsOC.h"
+#import "ASBaseNavigationController.h"
+
+@interface CustomTabBarController ()
+
+@end
+
+@implementation CustomTabBarController
+
+- (void)viewDidLoad {
+    [super viewDidLoad];
+    
+    [self setupViewControllers];
+    [self customizeTabBarAppearance];
+}
+
+- (void)setupViewControllers {
+    
+    APAudioToRingVC *firstVC = [[APAudioToRingVC alloc] init];
+    ASBaseNavigationController *firstNav = [[ASBaseNavigationController alloc] initWithRootViewController:firstVC];
+    firstNav.tabBarItem = [[UITabBarItem alloc] initWithTitle:@"Create".localized
+                                                        image:[[UIImage imageNamed:@"tabbar_unSelect_audio"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]
+                                                selectedImage:[[UIImage imageNamed:@"tabbar_selected_audio"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]];
+    
+
+    APRingTonesVC *secondVC = [[APRingTonesVC alloc] init];
+    ASBaseNavigationController *secondNav = [[ASBaseNavigationController alloc] initWithRootViewController:secondVC];
+    secondNav.tabBarItem = [[UITabBarItem alloc] initWithTitle:@"Audio".localized
+                                                         image:[[UIImage imageNamed:@"tabbar_unSelect_create"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]
+                                                 selectedImage:[[UIImage imageNamed:@"tabbar_selected_create"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]];
+    
+    APMyRingVC *thirdVC = [[APMyRingVC alloc] init];
+    ASBaseNavigationController *thirdNav = [[ASBaseNavigationController alloc] initWithRootViewController:thirdVC];
+    thirdNav.tabBarItem = [[UITabBarItem alloc] initWithTitle:@"Mine".localized
+                                                        image:[[UIImage imageNamed:@"tabbar_unSelect_mine"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]
+                                                selectedImage:[[UIImage imageNamed:@"tabbar_selected_mine"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]];
+    
+    APSettingVC *fourVC = [[APSettingVC alloc] init];
+    ASBaseNavigationController *fourNav = [[ASBaseNavigationController alloc] initWithRootViewController:fourVC];
+    fourNav.tabBarItem = [[UITabBarItem alloc] initWithTitle:@"Setting".localized
+                                                       image:[[UIImage imageNamed:@"tabbar_unSelect_setting"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]
+                                               selectedImage:[[UIImage imageNamed:@"tabbar_selected_setting"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]];
+    
+    // 设置标签栏控制器
+    self.viewControllers = @[firstNav, secondNav, thirdNav,fourNav];
+    self.selectedIndex = 0; // 默认选中第一个
+}
+
+- (void)customizeTabBarAppearance {
+
+    self.tabBar.barStyle = UIBarStyleBlack;
+    [self.tabBar setTranslucent:NO];
+    self.tabBar.backgroundColor = @"#1E1D29".uiColor;
+    self.view.backgroundColor = [UIColor blackColor];
+    self.tabBar.backgroundImage = [self.tabBar.backgroundColor imageWithSize:CGSizeMake(k_ScreenWidth, k_TabBar_Height)];
+     
+    [[UITabBar appearance] setUnselectedItemTintColor:[[UIColor whiteColor]colorWithAlphaComponent:0.4]];
+    [[UITabBar appearance] setTintColor:[UIColor whiteColor]];
+    
+
+}
+
+@end

+ 16 - 0
AIPlayRingtones/Classes/BaseClass/ASBaseNavigationController.h

@@ -0,0 +1,16 @@
+//
+//  ASBaseNavigationController.h
+//  AIPlayRingtones
+//
+//  Created by mini on 2025/5/27.
+//
+
+#import <UIKit/UIKit.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface ASBaseNavigationController : UINavigationController
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 23 - 0
AIPlayRingtones/Classes/BaseClass/ASBaseNavigationController.m

@@ -0,0 +1,23 @@
+//
+//  ASBaseNavigationController.m
+//  AIPlayRingtones
+//
+//  Created by mini on 2025/5/27.
+//
+
+#import "ASBaseNavigationController.h"
+
+@interface ASBaseNavigationController ()
+
+@end
+
+@implementation ASBaseNavigationController
+
+- (void)viewDidLoad {
+    [super viewDidLoad];
+    self.navigationBar.hidden = YES;
+    self.view.backgroundColor = [UIColor clearColor];
+    self.interactivePopGestureRecognizer.enabled = YES;
+}
+
+@end

+ 19 - 0
AIPlayRingtones/Classes/BaseClass/ASBaseView.h

@@ -0,0 +1,19 @@
+//
+//  ASBaseView.h
+//  AIPlayRingtones
+//
+//  Created by mini on 2025/5/27.
+//
+
+#import <UIKit/UIKit.h>
+#import <Masonry.h>
+NS_ASSUME_NONNULL_BEGIN
+
+@interface ASBaseView : UIView
+@property (nonatomic, strong) UIView *contentView;
+
+- (void)creatUI;
+- (void)dealThings;
+@end
+
+NS_ASSUME_NONNULL_END

+ 55 - 0
AIPlayRingtones/Classes/BaseClass/ASBaseView.m

@@ -0,0 +1,55 @@
+//
+//  ASBaseView.m
+//  AIPlayRingtones
+//
+//  Created by mini on 2025/5/27.
+//
+
+#import "ASBaseView.h"
+
+@implementation ASBaseView
+
+
+- (instancetype)initWithFrame:(CGRect)frame {
+    self = [super initWithFrame:frame];
+    if (self) {
+        [self commonInit];
+    }
+    return self;
+}
+
+- (instancetype)initWithCoder:(NSCoder *)coder {
+    self = [super initWithCoder:coder];
+    if (self) {
+        [self commonInit];
+    }
+    return self;
+}
+
+- (void)commonInit {
+    self.backgroundColor = [UIColor clearColor];
+    
+    // 初始化 contentView
+    _contentView = [[UIView alloc] init];
+    _contentView.backgroundColor = [UIColor clearColor];
+    [self addSubview:_contentView];
+    
+    // 使用 Masonry 设置约束(相当于 Swift 的 SnapKit)
+    [_contentView mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.top.leading.trailing.bottom.equalTo(@0);
+    }];
+    
+    // 调用子类实现的方法
+    [self creatUI];
+    [self dealThings];
+}
+
+- (void)creatUI {
+    // 子类重写此方法
+}
+
+- (void)dealThings {
+    // 子类重写此方法
+}
+
+@end

+ 1 - 1
AIPlayRingtones/Classes/BaseClass/TSBaseNavigationBarView.swift

@@ -156,7 +156,7 @@ open class TSNormalNavigationBarView: TSBaseNavContentBarView {
         if imageName.count > 0 {
             let image = UIImage(named: imageName)?.withRenderingMode(.alwaysOriginal)
             if let image = image {
-                button.setImage(image.mirror, for: .normal)
+                button.setImage(image, for: .normal)
             }
         }
 

+ 2 - 95
AIPlayRingtones/Classes/BaseClass/TSBaseNavigationC.swift

@@ -7,104 +7,11 @@
 
 import UIKit
 
-open class TSBaseNavigationC: UINavigationController, UIGestureRecognizerDelegate, UINavigationControllerDelegate, UINavigationBarDelegate {
-
-//    /// Whether to use system pop gesture. If false, full-screen pop gesture will be set.
-//    static let useSystemGesture: Bool = false
-//    /// Whether to enable global pop gestures. The default is true.
-//    static let popGestureEnabled: Bool = true
-//
-//    private var vcsDic: [String: Bool] = [:]
-
+open class TSBaseNavigationC: UINavigationController{
     open override func viewDidLoad() {
         super.viewDidLoad()
-        configureNavigationBar()
-//        configureNavigationGestures()
+        self.navigationBar.isHidden = true
         view.backgroundColor = .clear
         interactivePopGestureRecognizer?.isEnabled = true;
     }
-
-    private func configureNavigationBar() {
-        self.navigationBar.isHidden = true
-    }
-//
-//    private func configureNavigationGestures() {
-//        vcsDic = [:]
-//        self.interactivePopGestureRecognizer?.delegate = self
-//    }
-//
-//    // Override pushViewController to initialize interactive pop gesture here.
-//    override func pushViewController(_ viewController: UIViewController, animated: Bool) {
-//        // Hide bottom bar only for the first pushed view controller
-//        viewController.hidesBottomBarWhenPushed = self.viewControllers.count == 1
-//        super.pushViewController(viewController, animated: animated)
-//        self.interactivePopGestureRecognizer?.isEnabled = TSBaseNavigationC.popGestureEnabled
-//    }
-//
-//    // MARK: - UIGestureRecognizerDelegate
-//
-//    func gestureRecognizerShouldBegin(_ gestureRecognizer: UIGestureRecognizer) -> Bool {
-//        // Disable pop gesture if it's the root view controller
-//        if self.viewControllers.count == 1 {
-//            return false
-//        }
-//        let vcKey = vcKeyFromVC(self.topViewController)
-//        if let vcKey = vcKey, let isEnabled = vcsDic[vcKey] {
-//            return isEnabled
-//        }
-//        return self.interactivePopGestureRecognizer?.isEnabled ?? true
-//    }
-//
-//    // MARK: - UINavigationControllerDelegate
-//
-//    func navigationController(_ navigationController: UINavigationController,
-//                              willShow viewController: UIViewController,
-//                              animated: Bool) {
-//        if #available(iOS 10.0, *) {
-//            viewController.transitionCoordinator?.notifyWhenInteractionChanges { context in
-//                if context.isCancelled { return }
-//                debugPrint("notifyWhenInteractionChanges context.isCancelled=\(context.isCancelled)")
-//            }
-//        }
-//    }
-//
-//    func navigationController(_ navigationController: UINavigationController,
-//                              didShow viewController: UIViewController,
-//                              animated: Bool) {
-//        let vcKey = vcKeyFromVC(viewController)
-//        if let vcKey = vcKey, vcsDic[vcKey] == nil {
-//            // Save pop gesture enabled value for each child view controller
-//            vcsDic[vcKey] = self.interactivePopGestureRecognizer?.isEnabled ?? true
-//        }
-//    }
-//
-//    // MARK: - UINavigationBarDelegate
-//
-//    func navigationBar(_ navigationBar: UINavigationBar, shouldPop item: UINavigationItem) -> Bool {
-//        return true
-//    }
-//
-//    // MARK: - Convenience Methods
-//
-//    private func vcKeyFromVC(_ viewController: UIViewController?) -> String? {
-//        guard let viewController = viewController else { return nil }
-//        return String(describing: type(of: viewController))
-//    }
-//
-//    func setSpecifiedViewControllerInteractivePopGestureEnabled(_ enabled: Bool) {
-//        let vcKey = vcKeyFromVC(self.topViewController)
-//        if let vcKey = vcKey {
-//            vcsDic[vcKey] = enabled
-//        }
-//    }
-//
-//    // MARK: - Status Bar
-//
-//    override var childForStatusBarStyle: UIViewController? {
-//        return self.topViewController
-//    }
-//
-//    deinit {
-////        debugPrint("TGRootNavigationController deinitialized")
-//    }
 }

+ 32 - 0
AIPlayRingtones/Classes/Ex/OC/NSString+AS.h

@@ -0,0 +1,32 @@
+//
+//  NSString+AS.h
+//  AIPlayRingtones
+//
+//  Created by mini on 2025/5/27.
+//
+
+#import <Foundation/Foundation.h>
+#import <UIKit/UIKit.h>
+#import <CommonCrypto/CommonDigest.h>
+NS_ASSUME_NONNULL_BEGIN
+
+
+
+@interface NSString (ASColor)
+
+@property (nonatomic, readonly) UIColor *uiColor;
+@property (nonatomic, readonly) CGColorRef uiCGColor;
+
+@end
+
+
+
+@interface NSString (CryptoExtension)
+
+@property (nonatomic, readonly) NSString *md5;
+@property (nonatomic, readonly) NSString *localized;
+
+@end
+
+
+NS_ASSUME_NONNULL_END

+ 45 - 0
AIPlayRingtones/Classes/Ex/OC/NSString+AS.m

@@ -0,0 +1,45 @@
+//
+//  NSString+AS.m
+//  AIPlayRingtones
+//
+//  Created by mini on 2025/5/27.
+//
+
+#import "NSString+AS.h"
+#import "UIColor+AS.h"
+@implementation NSString (ASColor)
+- (UIColor *)uiColor {
+    if (self.length == 0) {
+        return [UIColor clearColor];
+    }
+    return [UIColor fromHex:self];
+}
+
+- (CGColorRef)uiCGColor {
+    return self.uiColor.CGColor;
+}
+@end
+
+
+
+@implementation NSString (CryptoExtension)
+
+- (NSString *)md5 {
+    const char *cStr = [self UTF8String];
+    unsigned char digest[CC_MD5_DIGEST_LENGTH];
+    CC_MD5(cStr, (CC_LONG)strlen(cStr), digest);
+    
+    NSMutableString *output = [NSMutableString stringWithCapacity:CC_MD5_DIGEST_LENGTH * 2];
+    
+    for(int i = 0; i < CC_MD5_DIGEST_LENGTH; i++) {
+        [output appendFormat:@"%02x", digest[i]];
+    }
+    
+    return [output copy];
+}
+
+- (NSString *)localized {
+    return NSLocalizedString(self, self);
+}
+
+@end

+ 30 - 0
AIPlayRingtones/Classes/Ex/OC/UIColor+AS.h

@@ -0,0 +1,30 @@
+//
+//  UIColor+AS.h
+//  AIPlayRingtones
+//
+//  Created by mini on 2025/5/27.
+//
+
+#import <UIKit/UIKit.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface UIColor (ASHex)
+
++ (UIColor *)fromHex:(NSString *)hexString;
+
+@end
+
+
+@interface UIColor (ImageExtension)
+/**
+ 将颜色转换为指定大小的图片
+
+ @param size 图片大小
+ @return 生成的图片
+ */
+- (UIImage *)imageWithSize:(CGSize)size;
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 70 - 0
AIPlayRingtones/Classes/Ex/OC/UIColor+AS.m

@@ -0,0 +1,70 @@
+//
+//  UIColor+AS.m
+//  AIPlayRingtones
+//
+//  Created by mini on 2025/5/27.
+//
+
+#import "UIColor+AS.h"
+#import <UIKit/UIKit.h>
+
+@implementation UIColor (ASHex)
+
++ (UIColor *)fromHex:(NSString *)hexString {
+    NSString *cleanString = [hexString stringByReplacingOccurrencesOfString:@"#" withString:@""];
+    
+    if (cleanString.length == 3) {
+        cleanString = [NSString stringWithFormat:@"%@%@%@%@%@%@",
+                       [cleanString substringWithRange:NSMakeRange(0, 1)],
+                       [cleanString substringWithRange:NSMakeRange(0, 1)],
+                       [cleanString substringWithRange:NSMakeRange(1, 1)],
+                       [cleanString substringWithRange:NSMakeRange(1, 1)],
+                       [cleanString substringWithRange:NSMakeRange(2, 1)],
+                       [cleanString substringWithRange:NSMakeRange(2, 1)]];
+    }
+    
+    if (cleanString.length == 6) {
+        cleanString = [cleanString stringByAppendingString:@"ff"];
+    }
+    
+    unsigned int rgbaValue = 0;
+    [[NSScanner scannerWithString:cleanString] scanHexInt:&rgbaValue];
+    
+    CGFloat red = ((rgbaValue & 0xFF000000) >> 24) / 255.0f;
+    CGFloat green = ((rgbaValue & 0x00FF0000) >> 16) / 255.0f;
+    CGFloat blue = ((rgbaValue & 0x0000FF00) >> 8) / 255.0f;
+    CGFloat alpha = (rgbaValue & 0x000000FF) / 255.0f;
+    
+    return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
+}
+
+@end
+
+
+@implementation UIColor (ImageExtension)
+
+- (UIImage *)imageWithSize:(CGSize)size {
+    // 确保大小有效
+    if (size.width <= 0 || size.height <= 0) {
+        return nil;
+    }
+    
+    // 创建绘图上下文
+    CGRect rect = CGRectMake(0, 0, size.width, size.height);
+    UIGraphicsBeginImageContextWithOptions(rect.size, NO, [UIScreen mainScreen].scale);
+    
+    // 设置填充颜色并绘制矩形
+    CGContextRef context = UIGraphicsGetCurrentContext();
+    CGContextSetFillColorWithColor(context, self.CGColor);
+    CGContextFillRect(context, rect);
+    
+    // 获取生成的图片
+    UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
+    
+    // 结束绘图上下文
+    UIGraphicsEndImageContext();
+    
+    return image;
+}
+
+@end

+ 0 - 12
AIPlayRingtones/Classes/Ex/UIImage+Ex.swift

@@ -32,18 +32,6 @@ public extension UIImage {
     }
 }
 
-public extension UIImage {
-    var mirror: UIImage {
-//        guard TSConfig.appLanguage.hasPrefix("ar"), let cgImage = self.cgImage else {
-        guard let cgImage = self.cgImage else {
-            return self
-        }
-        let image = UIImage(cgImage: cgImage, scale: self.scale, orientation: Orientation.upMirrored)
-        return image.withRenderingMode(self.renderingMode)
-    }
-
-}
-
 public extension UIImage {
     // 压缩图片到指定尺寸
     func compressImageSize(to size: CGSize) -> UIImage {

+ 2 - 0
AIPlayRingtones/Classes/GlobalImports/GlobalImports.swift

@@ -145,3 +145,5 @@ public func kGetVideoThumbnail(from videoURL: URL) -> UIImage? {
 public func kShowToastDataMissing(){
     
 }
+
+

+ 63 - 0
AIPlayRingtones/Classes/GlobalImports/GlobalImportsOC.h

@@ -0,0 +1,63 @@
+//
+//  GlobalImportsOC.h
+//  AIPlayRingtones
+//
+//  Created by mini on 2025/5/27.
+//
+
+#ifndef GlobalMacros_h
+#define GlobalMacros_h
+
+// 防止重复包含的宏
+#pragma once
+
+// 屏幕尺寸宏定义
+#define k_ScreenWidth [UIScreen mainScreen].bounds.size.width
+#define k_ScreenHeight [UIScreen mainScreen].bounds.size.height
+#define k_Height_NavBar 44.0f
+#define k_TabBar_Height 49.0f
+
+// 状态栏高度
+static inline CGFloat k_Height_statusBar() {
+    if (@available(iOS 13.0, *)) {
+        UIWindowScene *windowScene = [UIApplication sharedApplication].connectedScenes.allObjects.firstObject;
+        return windowScene.statusBarManager.statusBarFrame.size.height;
+    } else {
+        return [UIApplication sharedApplication].statusBarFrame.size.height;
+    }
+}
+
+// 安全区高度
+static inline CGFloat k_Height_safeAreaInsetsTop() {
+    if (@available(iOS 13.0, *)) {
+        UIWindowScene *windowScene = [UIApplication sharedApplication].connectedScenes.allObjects.firstObject;
+        return windowScene.windows.firstObject.safeAreaInsets.top;
+    } else if (@available(iOS 11.0, *)) {
+        return [UIApplication sharedApplication].windows.firstObject.safeAreaInsets.top;
+    }
+    return 0;
+}
+
+static inline CGFloat k_Height_safeAreaInsetsBottom() {
+    if (@available(iOS 13.0, *)) {
+        UIWindowScene *windowScene = [UIApplication sharedApplication].connectedScenes.allObjects.firstObject;
+        return windowScene.windows.firstObject.safeAreaInsets.bottom;
+    } else if (@available(iOS 11.0, *)) {
+        return [UIApplication sharedApplication].windows.firstObject.safeAreaInsets.bottom;
+    }
+    return 0;
+}
+
+// 组合高度
+#define k_Height_StatusBar k_Height_statusBar()
+#define k_Nav_Height (k_Height_NavBar + k_Height_StatusBar)
+#define k_Height_TabBar (k_Height_safeAreaInsetsBottom() + k_TabBar_Height)
+
+// 判断iPhoneX系列
+static inline BOOL isIphoneX() {
+    return k_Height_safeAreaInsetsBottom() > 0.0;
+}
+
+
+
+#endif /* GlobalMacros_h */

+ 1 - 0
Podfile

@@ -18,6 +18,7 @@ target 'AIPlayRingtones' do
   #pod 'TSSmalCoacopods', :path => '../TSSmalCoacopods'
   pod 'RealmSwift', '~>10'
   pod 'SVProgressHUD'
+  pod 'Masonry'
   
 end
 

+ 5 - 1
Podfile.lock

@@ -41,6 +41,7 @@ PODS:
   - IQTextView (1.0.5):
     - IQKeyboardToolbar/Placeholderable
   - Kingfisher (7.10.0)
+  - Masonry (1.1.0)
   - ObjectMapper (4.4.2)
   - Realm (10.54.2):
     - Realm/Headers (= 10.54.2)
@@ -57,6 +58,7 @@ DEPENDENCIES:
   - Alamofire
   - IQKeyboardManagerSwift
   - Kingfisher (= 7.10.0)
+  - Masonry
   - ObjectMapper
   - RealmSwift (~> 10)
   - SnapKit
@@ -75,6 +77,7 @@ SPEC REPOS:
     - IQTextInputViewNotification
     - IQTextView
     - Kingfisher
+    - Masonry
     - ObjectMapper
     - Realm
     - RealmSwift
@@ -93,6 +96,7 @@ SPEC CHECKSUMS:
   IQTextInputViewNotification: f5e954d8881fd9808b744e49e024cc0d4bcfe572
   IQTextView: ae13b4922f22e6f027f62c557d9f4f236b19d5c7
   Kingfisher: a18f05d3b6d37d8650ee4a3e61d57a28fc6207f6
+  Masonry: 678fab65091a9290e40e2832a55e7ab731aad201
   ObjectMapper: e6e4d91ff7f2861df7aecc536c92d8363f4c9677
   Realm: 16852517a207e98cc6acba9336b56c30d06d84ad
   RealmSwift: bca777b3904ee58a9b16036e1840012f03348060
@@ -100,6 +104,6 @@ SPEC CHECKSUMS:
   SVProgressHUD: 4837c74bdfe2e51e8821c397825996a8d7de6e22
   SwipeCellKit: 3972254a826da74609926daf59b08d6c72e619ea
 
-PODFILE CHECKSUM: 20b0d18adc2c2ae41c11f9d74f5e31fe5b678fe0
+PODFILE CHECKSUM: 1071d261443cc061af98a045c6783dc1ea510988
 
 COCOAPODS: 1.16.2