소스 검색

移除多余的TSCustomStackView

100Years 1 개월 전
부모
커밋
3864fb1a95

+ 0 - 12
AIRingtone.xcodeproj/project.pbxproj

@@ -17,7 +17,6 @@
 		A80EDECB2D718CEA003CD332 /* TSNetWork+Business.swift in Sources */ = {isa = PBXBuildFile; fileRef = A80EDE6D2D718CEA003CD332 /* TSNetWork+Business.swift */; };
 		A80EDEDB2D718CEA003CD332 /* TSPhotoPickerManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = A80EDEBB2D718CEA003CD332 /* TSPhotoPickerManager.swift */; };
 		A80EDEE32D718CEA003CD332 /* TSNetworkManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = A80EDE6C2D718CEA003CD332 /* TSNetworkManager.swift */; };
-		A80EDEE72D718CEA003CD332 /* TSCustomStackView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A80EDEBD2D718CEA003CD332 /* TSCustomStackView.swift */; };
 		A80EDEE92D718CEA003CD332 /* TSFileManagerTool.swift in Sources */ = {isa = PBXBuildFile; fileRef = A80EDEB62D718CEA003CD332 /* TSFileManagerTool.swift */; };
 		A80EDEEA2D718CEA003CD332 /* PaddedLabel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A80EDEBF2D718CEA003CD332 /* PaddedLabel.swift */; };
 		A80EDEEB2D718CEA003CD332 /* StreamPostRequest.swift in Sources */ = {isa = PBXBuildFile; fileRef = A80EDE6F2D718CEA003CD332 /* StreamPostRequest.swift */; };
@@ -127,7 +126,6 @@
 		A80EDEB62D718CEA003CD332 /* TSFileManagerTool.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TSFileManagerTool.swift; sourceTree = "<group>"; };
 		A80EDEB92D718CEA003CD332 /* WindowHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WindowHelper.swift; sourceTree = "<group>"; };
 		A80EDEBB2D718CEA003CD332 /* TSPhotoPickerManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TSPhotoPickerManager.swift; sourceTree = "<group>"; };
-		A80EDEBD2D718CEA003CD332 /* TSCustomStackView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TSCustomStackView.swift; sourceTree = "<group>"; };
 		A80EDEBF2D718CEA003CD332 /* PaddedLabel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PaddedLabel.swift; sourceTree = "<group>"; };
 		A80EDEF32D718DEA003CD332 /* TSTabBarController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TSTabBarController.swift; sourceTree = "<group>"; };
 		A80EDEF62D718DF1003CD332 /* TSBusinessWebVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TSBusinessWebVC.swift; sourceTree = "<group>"; };
@@ -358,14 +356,6 @@
 			path = TSPhotoPickerManager;
 			sourceTree = "<group>";
 		};
-		A80EDEBE2D718CEA003CD332 /* UIStackView */ = {
-			isa = PBXGroup;
-			children = (
-				A80EDEBD2D718CEA003CD332 /* TSCustomStackView.swift */,
-			);
-			path = UIStackView;
-			sourceTree = "<group>";
-		};
 		A80EDEC02D718CEA003CD332 /* UILabel */ = {
 			isa = PBXGroup;
 			children = (
@@ -378,7 +368,6 @@
 			isa = PBXGroup;
 			children = (
 				A80EDEBC2D718CEA003CD332 /* TSPhotoPickerManager */,
-				A80EDEBE2D718CEA003CD332 /* UIStackView */,
 				A80EDEC02D718CEA003CD332 /* UILabel */,
 			);
 			path = View;
@@ -987,7 +976,6 @@
 				A868A8AF2D758BBC00F6D884 /* TSTBDesktopPreviewView.swift in Sources */,
 				A80EDEF52D718DEA003CD332 /* TSTabBarController.swift in Sources */,
 				A868A8B52D7598C000F6D884 /* TSTSIslandView.swift in Sources */,
-				A80EDEE72D718CEA003CD332 /* TSCustomStackView.swift in Sources */,
 				A8272E9F2D7A8F6500F1C814 /* TSGeneralRintoneVM.swift in Sources */,
 				A868A9142D784D4D00F6D884 /* TSGeneralPicModel.swift in Sources */,
 				A868A8D52D76E41800F6D884 /* TSSetContactAvatar.swift in Sources */,

+ 0 - 2
AIRingtone/Business/TSAIRintoneVC/TSTextGeneralRintoneVC/VM/TSTextGeneralRintoneVM.swift

@@ -5,10 +5,8 @@
 //  Created by 100Years on 2025/3/6.
 //
 
-import Alamofire
 import ObjectMapper
 
-
 let kRandomTextToRintone:[String] = [
     "Create a upbeat Pop ringtone with a catchy melody, bright synths, and a cheerful vibe. Use a BPM of 120-130 and keep it energetic and memorable.",
     "Generate a cinematic ringtone with orchestral strings, powerful brass, and a dramatic build-up. Use a BPM of 60-80 for a grand, inspiring feel.",

+ 0 - 198
AIRingtone/Common/View/UIStackView/TSCustomStackView.swift

@@ -1,198 +0,0 @@
-//
-//  CustomStackView.swift
-//  TestUIKit
-//
-//  Created by 100Years on 2025/2/24.
-//
-
-import UIKit
-import SnapKit
-
-class TSCustomStackView: UIView {
-    // 内部的 UIScrollView 和 UIStackView
-    private let scrollView: UIScrollView
-    private let stackView: UIStackView
-    
-    // 开放的属性,用于设置方向和间距
-    var axis: NSLayoutConstraint.Axis {
-        get {
-            return stackView.axis
-        }
-        set {
-            stackView.axis = newValue
-            updateScrollViewConstraints()
-        }
-    }
-    
-    var spacing: CGFloat {
-        get {
-            return stackView.spacing
-        }
-        set {
-            stackView.spacing = newValue
-        }
-    }
-    
-    var viewH:CGFloat {
-        get {
-            return scrollView.contentSize.height
-        }
-    }
-    
-    // 初始化方法
-    init(axis: NSLayoutConstraint.Axis = .vertical, spacing: CGFloat = 0) {
-        self.scrollView = UIScrollView()
-        self.stackView = UIStackView()
-        self.stackView.axis = axis
-        self.stackView.spacing = spacing
-        self.stackView.alignment = .fill
-        self.stackView.distribution = .fill
-        super.init(frame: .zero)
-        setupUI()
-    }
-    
-    required init?(coder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-    
-    // 设置 UI
-    private func setupUI() {
-        // 添加 scrollView
-        addSubview(scrollView)
-        scrollView.snp.makeConstraints { make in
-            make.edges.equalToSuperview()
-        }
-        
-        // 添加 stackView 到 scrollView
-        scrollView.addSubview(stackView)
-        updateScrollViewConstraints()
-    }
-    
-    // 根据轴方向更新约束
-    private func updateScrollViewConstraints() {
-        stackView.snp.remakeConstraints { make in
-            make.edges.equalToSuperview()
-            
-            // 根据轴方向设置 contentSize
-            if axis == .vertical {
-                make.width.equalTo(scrollView)
-            } else {
-                make.height.equalTo(scrollView)
-            }
-        }
-    }
-    
-    // 动态添加子视图的方法
-    func addSubviewToStack(_ view: UIView) {
-        stackView.addArrangedSubview(view)
-        // 可以根据需要对子视图进行额外的布局设置
-        view.snp.makeConstraints { make in
-            if axis == .vertical {
-                make.width.equalTo(stackView)
-            } else {
-                make.height.equalTo(stackView)
-            }
-        }
-    }
-    
-    // 在指定位置插入子视图
-    func insertViewToStack(_ view: UIView, at stackIndex: Int) {
-        stackView.insertArrangedSubview(view, at: stackIndex)
-        // 可以根据需要对子视图进行额外的布局设置
-        view.snp.makeConstraints { make in
-            if axis == .vertical {
-                make.width.equalTo(stackView)
-            } else {
-                make.height.equalTo(stackView)
-            }
-        }
-    }
-    
-    // 移除子视图
-    func removeViewToStack(_ view: UIView) {
-        stackView.removeArrangedSubview(view)
-        view.removeFromSuperview()
-    }
-}
-
-
-//class TSCustomStackView: UIView {
-//    // 内部的 UIStackView
-//    private let stackView: UIStackView
-//    
-//    // 开放的属性,用于设置方向和间距
-//    var axis: NSLayoutConstraint.Axis {
-//        get {
-//            return stackView.axis
-//        }
-//        set {
-//            stackView.axis = newValue
-//        }
-//    }
-//    
-//    var spacing: CGFloat {
-//        get {
-//            return stackView.spacing
-//        }
-//        set {
-//            stackView.spacing = newValue
-//        }
-//    }
-//    
-//    // 初始化方法
-//    init(axis: NSLayoutConstraint.Axis = .vertical, spacing: CGFloat = 0) {
-//        self.stackView = UIStackView()
-//        self.stackView.axis = axis
-//        self.stackView.spacing = spacing
-//        self.stackView.alignment = .fill
-//        self.stackView.distribution = .fill
-//        super.init(frame: .zero)
-//        setupUI()
-//    }
-//    
-//    required init?(coder: NSCoder) {
-//        fatalError("init(coder:) has not been implemented")
-//    }
-//    
-//    // 设置 UI
-//    private func setupUI() {
-//        addSubview(stackView)
-//        stackView.snp.makeConstraints { make in
-//            make.edges.equalToSuperview()
-//        }
-//    }
-//    
-//    // 动态添加子视图的方法
-//    func addSubviewToStack(_ view: UIView) {
-//        stackView.addArrangedSubview(view)
-//        // 可以根据需要对子视图进行额外的布局设置
-//        view.snp.makeConstraints { make in
-//            if axis == .vertical {
-//                make.width.equalTo(stackView)
-//            } else {
-//                make.height.equalTo(stackView)
-//            }
-//        }
-//    }
-//    
-//    
-//    // 动态添加子视图的方法
-//    func insertViewToStack(_ view: UIView, at stackIndex: Int){
-//        stackView.insertArrangedSubview(view, at: 0)
-//        // 可以根据需要对子视图进行额外的布局设置
-//        view.snp.makeConstraints { make in
-//            if axis == .vertical {
-//                make.width.equalTo(stackView)
-//            } else {
-//                make.height.equalTo(stackView)
-//            }
-//        }
-//    }
-//        
-//    func removeViewToStack(_ view: UIView){
-//        stackView.removeArrangedSubview(view)
-//        view.removeFromSuperview()
-//    }
-//        
-//        
-//}