From 045d5eaff880e5aebe92debb0ea875daaa306861 Mon Sep 17 00:00:00 2001 From: CodeST <694468528@qq.com> Date: Wed, 29 Oct 2025 14:17:26 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9B=E5=BB=BAbase?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- keyBoard.xcodeproj/project.pbxproj | 164 ++++++++++++++++++ keyBoard/AppDelegate.m | 18 +- .../Class/Base/VC/BaseNavigationController.h | 16 ++ .../Class/Base/VC/BaseNavigationController.m | 28 +++ keyBoard/Class/Home/VC/HomeVC.h | 16 ++ keyBoard/Class/Home/VC/HomeVC.m | 31 ++++ keyBoard/Class/Main/VC/BaseTabBarController.h | 16 ++ keyBoard/Class/Main/VC/BaseTabBarController.m | 33 ++++ keyBoard/Class/Me/VC/MyVC.h | 16 ++ keyBoard/Class/Me/VC/MyVC.m | 31 ++++ keyBoard/KeyBoardPrefixHeader.pch | 3 + 11 files changed, 367 insertions(+), 5 deletions(-) create mode 100644 keyBoard/Class/Base/VC/BaseNavigationController.h create mode 100644 keyBoard/Class/Base/VC/BaseNavigationController.m create mode 100644 keyBoard/Class/Home/VC/HomeVC.h create mode 100644 keyBoard/Class/Home/VC/HomeVC.m create mode 100644 keyBoard/Class/Main/VC/BaseTabBarController.h create mode 100644 keyBoard/Class/Main/VC/BaseTabBarController.m create mode 100644 keyBoard/Class/Me/VC/MyVC.h create mode 100644 keyBoard/Class/Me/VC/MyVC.m diff --git a/keyBoard.xcodeproj/project.pbxproj b/keyBoard.xcodeproj/project.pbxproj index 1b5e18e..eb5d972 100644 --- a/keyBoard.xcodeproj/project.pbxproj +++ b/keyBoard.xcodeproj/project.pbxproj @@ -25,6 +25,10 @@ 04FC95762EB095DE007BD342 /* KBFunctionPasteView.m in Sources */ = {isa = PBXBuildFile; fileRef = 04FC95752EB095DE007BD342 /* KBFunctionPasteView.m */; }; 04FC95792EB09BC8007BD342 /* KBKeyBoardMainView.m in Sources */ = {isa = PBXBuildFile; fileRef = 04FC95782EB09BC8007BD342 /* KBKeyBoardMainView.m */; }; 04FC95B22EB0B2CC007BD342 /* KBSettingView.m in Sources */ = {isa = PBXBuildFile; fileRef = 04FC95B12EB0B2CC007BD342 /* KBSettingView.m */; }; + 04FC95C92EB1E4C9007BD342 /* BaseNavigationController.m in Sources */ = {isa = PBXBuildFile; fileRef = 04FC95C82EB1E4C9007BD342 /* BaseNavigationController.m */; }; + 04FC95CC2EB1E780007BD342 /* BaseTabBarController.m in Sources */ = {isa = PBXBuildFile; fileRef = 04FC95CB2EB1E780007BD342 /* BaseTabBarController.m */; }; + 04FC95CF2EB1E7A1007BD342 /* HomeVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 04FC95CE2EB1E7A1007BD342 /* HomeVC.m */; }; + 04FC95D22EB1E7AE007BD342 /* MyVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 04FC95D12EB1E7AE007BD342 /* MyVC.m */; }; 7A36414DFDA5BEC9B7D2E318 /* Pods_CustomKeyboard.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2C1092FB2B452F95B15D4263 /* Pods_CustomKeyboard.framework */; }; A1B2C3D42EB0A0A100000001 /* KBFunctionTagCell.m in Sources */ = {isa = PBXBuildFile; fileRef = A1B2C3D32EB0A0A100000001 /* KBFunctionTagCell.m */; }; A1B2C3E22EB0C0A100000001 /* KBNetworkManager.m in Sources */ = {isa = PBXBuildFile; fileRef = A1B2C3E12EB0C0A100000001 /* KBNetworkManager.m */; }; @@ -91,6 +95,14 @@ 04FC95782EB09BC8007BD342 /* KBKeyBoardMainView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = KBKeyBoardMainView.m; sourceTree = ""; }; 04FC95B02EB0B2CC007BD342 /* KBSettingView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KBSettingView.h; sourceTree = ""; }; 04FC95B12EB0B2CC007BD342 /* KBSettingView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = KBSettingView.m; sourceTree = ""; }; + 04FC95C72EB1E4C9007BD342 /* BaseNavigationController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BaseNavigationController.h; sourceTree = ""; }; + 04FC95C82EB1E4C9007BD342 /* BaseNavigationController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BaseNavigationController.m; sourceTree = ""; }; + 04FC95CA2EB1E780007BD342 /* BaseTabBarController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BaseTabBarController.h; sourceTree = ""; }; + 04FC95CB2EB1E780007BD342 /* BaseTabBarController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BaseTabBarController.m; sourceTree = ""; }; + 04FC95CD2EB1E7A1007BD342 /* HomeVC.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HomeVC.h; sourceTree = ""; }; + 04FC95CE2EB1E7A1007BD342 /* HomeVC.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = HomeVC.m; sourceTree = ""; }; + 04FC95D02EB1E7AE007BD342 /* MyVC.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MyVC.h; sourceTree = ""; }; + 04FC95D12EB1E7AE007BD342 /* MyVC.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MyVC.m; sourceTree = ""; }; 2C1092FB2B452F95B15D4263 /* Pods_CustomKeyboard.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_CustomKeyboard.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 51FE7C4C42C2255B3C1C4128 /* Pods-keyBoard.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-keyBoard.release.xcconfig"; path = "Target Support Files/Pods-keyBoard/Pods-keyBoard.release.xcconfig"; sourceTree = ""; }; 727EC7532EAF848B00B36487 /* keyBoard.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = keyBoard.app; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -127,6 +139,7 @@ 04C6EAB92EAF86530089C901 /* keyBoard */ = { isa = PBXGroup; children = ( + 04FC95BF2EB1E3B1007BD342 /* Class */, 04C6EAE32EAF942E0089C901 /* VC */, 04C6EAAC2EAF86530089C901 /* AppDelegate.h */, 04C6EAAD2EAF86530089C901 /* AppDelegate.m */, @@ -199,6 +212,149 @@ path = Model; sourceTree = ""; }; + 04FC95B32EB1E3B1007BD342 /* M */ = { + isa = PBXGroup; + children = ( + ); + path = M; + sourceTree = ""; + }; + 04FC95B42EB1E3B1007BD342 /* V */ = { + isa = PBXGroup; + children = ( + ); + path = V; + sourceTree = ""; + }; + 04FC95B52EB1E3B1007BD342 /* VC */ = { + isa = PBXGroup; + children = ( + 04FC95CD2EB1E7A1007BD342 /* HomeVC.h */, + 04FC95CE2EB1E7A1007BD342 /* HomeVC.m */, + ); + path = VC; + sourceTree = ""; + }; + 04FC95B62EB1E3B1007BD342 /* Home */ = { + isa = PBXGroup; + children = ( + 04FC95B32EB1E3B1007BD342 /* M */, + 04FC95B42EB1E3B1007BD342 /* V */, + 04FC95B52EB1E3B1007BD342 /* VC */, + ); + path = Home; + sourceTree = ""; + }; + 04FC95B72EB1E3B1007BD342 /* M */ = { + isa = PBXGroup; + children = ( + ); + path = M; + sourceTree = ""; + }; + 04FC95B82EB1E3B1007BD342 /* V */ = { + isa = PBXGroup; + children = ( + ); + path = V; + sourceTree = ""; + }; + 04FC95B92EB1E3B1007BD342 /* VC */ = { + isa = PBXGroup; + children = ( + 04FC95CA2EB1E780007BD342 /* BaseTabBarController.h */, + 04FC95CB2EB1E780007BD342 /* BaseTabBarController.m */, + ); + path = VC; + sourceTree = ""; + }; + 04FC95BA2EB1E3B1007BD342 /* Main */ = { + isa = PBXGroup; + children = ( + 04FC95B72EB1E3B1007BD342 /* M */, + 04FC95B82EB1E3B1007BD342 /* V */, + 04FC95B92EB1E3B1007BD342 /* VC */, + ); + path = Main; + sourceTree = ""; + }; + 04FC95BB2EB1E3B1007BD342 /* M */ = { + isa = PBXGroup; + children = ( + ); + path = M; + sourceTree = ""; + }; + 04FC95BC2EB1E3B1007BD342 /* V */ = { + isa = PBXGroup; + children = ( + ); + path = V; + sourceTree = ""; + }; + 04FC95BD2EB1E3B1007BD342 /* VC */ = { + isa = PBXGroup; + children = ( + 04FC95D02EB1E7AE007BD342 /* MyVC.h */, + 04FC95D12EB1E7AE007BD342 /* MyVC.m */, + ); + path = VC; + sourceTree = ""; + }; + 04FC95BE2EB1E3B1007BD342 /* Me */ = { + isa = PBXGroup; + children = ( + 04FC95BB2EB1E3B1007BD342 /* M */, + 04FC95BC2EB1E3B1007BD342 /* V */, + 04FC95BD2EB1E3B1007BD342 /* VC */, + ); + path = Me; + sourceTree = ""; + }; + 04FC95BF2EB1E3B1007BD342 /* Class */ = { + isa = PBXGroup; + children = ( + 04FC95C62EB1E4AB007BD342 /* Base */, + 04FC95BA2EB1E3B1007BD342 /* Main */, + 04FC95B62EB1E3B1007BD342 /* Home */, + 04FC95BE2EB1E3B1007BD342 /* Me */, + ); + path = Class; + sourceTree = ""; + }; + 04FC95C32EB1E4AB007BD342 /* M */ = { + isa = PBXGroup; + children = ( + ); + path = M; + sourceTree = ""; + }; + 04FC95C42EB1E4AB007BD342 /* V */ = { + isa = PBXGroup; + children = ( + ); + path = V; + sourceTree = ""; + }; + 04FC95C52EB1E4AB007BD342 /* VC */ = { + isa = PBXGroup; + children = ( + 04FC95C72EB1E4C9007BD342 /* BaseNavigationController.h */, + 04FC95C82EB1E4C9007BD342 /* BaseNavigationController.m */, + ); + path = VC; + sourceTree = ""; + }; + 04FC95C62EB1E4AB007BD342 /* Base */ = { + isa = PBXGroup; + children = ( + 04FC95C32EB1E4AB007BD342 /* M */, + 04FC95C42EB1E4AB007BD342 /* V */, + 04FC95C52EB1E4AB007BD342 /* VC */, + ); + path = Base; + sourceTree = ""; + }; 2C53A0856097DCFBE7B55649 /* Pods */ = { isa = PBXGroup; children = ( @@ -379,10 +535,14 @@ inputFileListPaths = ( "${PODS_ROOT}/Target Support Files/Pods-keyBoard/Pods-keyBoard-frameworks-${CONFIGURATION}-input-files.xcfilelist", ); + inputPaths = ( + ); name = "[CP] Embed Pods Frameworks"; outputFileListPaths = ( "${PODS_ROOT}/Target Support Files/Pods-keyBoard/Pods-keyBoard-frameworks-${CONFIGURATION}-output-files.xcfilelist", ); + outputPaths = ( + ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-keyBoard/Pods-keyBoard-frameworks.sh\"\n"; @@ -436,9 +596,13 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + 04FC95D22EB1E7AE007BD342 /* MyVC.m in Sources */, 043FBCD22EAF97630036AFE1 /* KBPermissionViewController.m in Sources */, 04C6EABE2EAF86530089C901 /* AppDelegate.m in Sources */, + 04FC95C92EB1E4C9007BD342 /* BaseNavigationController.m in Sources */, + 04FC95CF2EB1E7A1007BD342 /* HomeVC.m in Sources */, 04C6EABF2EAF86530089C901 /* main.m in Sources */, + 04FC95CC2EB1E780007BD342 /* BaseTabBarController.m in Sources */, 04C6EAC12EAF86530089C901 /* ViewController.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; diff --git a/keyBoard/AppDelegate.m b/keyBoard/AppDelegate.m index 7bae424..031d075 100644 --- a/keyBoard/AppDelegate.m +++ b/keyBoard/AppDelegate.m @@ -10,17 +10,16 @@ #import "KBPermissionViewController.h" #import #import +#import "BaseTabBarController.h" + static NSString * const kKBKeyboardExtensionBundleId = @"com.keyBoard.CustomKeyboard"; @implementation AppDelegate - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { - self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; - self.window.backgroundColor = [UIColor whiteColor]; - [self.window makeKeyAndVisible]; - ViewController *vc = [[ViewController alloc] init]; - self.window.rootViewController = vc; + + [self setupRootVC]; /// 获取网络权限 [self getNetJudge]; /// Bugly @@ -35,6 +34,15 @@ static NSString * const kKBKeyboardExtensionBundleId = @"com.keyBoard.CustomKeyb return YES; } + +- (void)setupRootVC{ + self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; + self.window.backgroundColor = [UIColor whiteColor]; + [self.window makeKeyAndVisible]; + BaseTabBarController *vc = [[BaseTabBarController alloc] init]; + self.window.rootViewController = vc; +} + #pragma mark - Permission presentation - (UIViewController *)kb_topMostViewController diff --git a/keyBoard/Class/Base/VC/BaseNavigationController.h b/keyBoard/Class/Base/VC/BaseNavigationController.h new file mode 100644 index 0000000..dbebd0b --- /dev/null +++ b/keyBoard/Class/Base/VC/BaseNavigationController.h @@ -0,0 +1,16 @@ +// +// BaseNavigationController.h +// keyBoard +// +// Created by Mac on 2025/10/29. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface BaseNavigationController : UINavigationController + +@end + +NS_ASSUME_NONNULL_END diff --git a/keyBoard/Class/Base/VC/BaseNavigationController.m b/keyBoard/Class/Base/VC/BaseNavigationController.m new file mode 100644 index 0000000..a882343 --- /dev/null +++ b/keyBoard/Class/Base/VC/BaseNavigationController.m @@ -0,0 +1,28 @@ +// +// BaseNavigationController.m +// keyBoard +// +// Created by Mac on 2025/10/29. +// + +#import "BaseNavigationController.h" + +@interface BaseNavigationController () + +@end + +@implementation BaseNavigationController + +- (void)viewDidLoad { + [super viewDidLoad]; + // Do any additional setup after loading the view. +} + +- (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated{ + if (self.viewControllers.count > 0) { + viewController.hidesBottomBarWhenPushed = true; + } + [super pushViewController:viewController animated:animated]; +} + +@end diff --git a/keyBoard/Class/Home/VC/HomeVC.h b/keyBoard/Class/Home/VC/HomeVC.h new file mode 100644 index 0000000..23d76f4 --- /dev/null +++ b/keyBoard/Class/Home/VC/HomeVC.h @@ -0,0 +1,16 @@ +// +// HomeVC.h +// keyBoard +// +// Created by Mac on 2025/10/29. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface HomeVC : UIViewController + +@end + +NS_ASSUME_NONNULL_END diff --git a/keyBoard/Class/Home/VC/HomeVC.m b/keyBoard/Class/Home/VC/HomeVC.m new file mode 100644 index 0000000..639fa80 --- /dev/null +++ b/keyBoard/Class/Home/VC/HomeVC.m @@ -0,0 +1,31 @@ +// +// HomeVC.m +// keyBoard +// +// Created by Mac on 2025/10/29. +// + +#import "HomeVC.h" + +@interface HomeVC () + +@end + +@implementation HomeVC + +- (void)viewDidLoad { + [super viewDidLoad]; + // Do any additional setup after loading the view. +} + +/* +#pragma mark - Navigation + +// In a storyboard-based application, you will often want to do a little preparation before navigation +- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { + // Get the new view controller using [segue destinationViewController]. + // Pass the selected object to the new view controller. +} +*/ + +@end diff --git a/keyBoard/Class/Main/VC/BaseTabBarController.h b/keyBoard/Class/Main/VC/BaseTabBarController.h new file mode 100644 index 0000000..b2a25ef --- /dev/null +++ b/keyBoard/Class/Main/VC/BaseTabBarController.h @@ -0,0 +1,16 @@ +// +// BaseTabBarController.h +// keyBoard +// +// Created by Mac on 2025/10/29. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface BaseTabBarController : UITabBarController + +@end + +NS_ASSUME_NONNULL_END diff --git a/keyBoard/Class/Main/VC/BaseTabBarController.m b/keyBoard/Class/Main/VC/BaseTabBarController.m new file mode 100644 index 0000000..fa3f39f --- /dev/null +++ b/keyBoard/Class/Main/VC/BaseTabBarController.m @@ -0,0 +1,33 @@ +// +// BaseTabBarController.m +// keyBoard +// +// Created by Mac on 2025/10/29. +// + +#import "BaseTabBarController.h" +#import "HomeVC.h" +#import "MyVC.h" + +@interface BaseTabBarController () + +@end + +@implementation BaseTabBarController + +- (void)viewDidLoad { + [super viewDidLoad]; + +} + +/* +#pragma mark - Navigation + +// In a storyboard-based application, you will often want to do a little preparation before navigation +- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { + // Get the new view controller using [segue destinationViewController]. + // Pass the selected object to the new view controller. +} +*/ + +@end diff --git a/keyBoard/Class/Me/VC/MyVC.h b/keyBoard/Class/Me/VC/MyVC.h new file mode 100644 index 0000000..a552cbe --- /dev/null +++ b/keyBoard/Class/Me/VC/MyVC.h @@ -0,0 +1,16 @@ +// +// MyVC.h +// keyBoard +// +// Created by Mac on 2025/10/29. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface MyVC : UIViewController + +@end + +NS_ASSUME_NONNULL_END diff --git a/keyBoard/Class/Me/VC/MyVC.m b/keyBoard/Class/Me/VC/MyVC.m new file mode 100644 index 0000000..1fd7b2f --- /dev/null +++ b/keyBoard/Class/Me/VC/MyVC.m @@ -0,0 +1,31 @@ +// +// MyVC.m +// keyBoard +// +// Created by Mac on 2025/10/29. +// + +#import "MyVC.h" + +@interface MyVC () + +@end + +@implementation MyVC + +- (void)viewDidLoad { + [super viewDidLoad]; + // Do any additional setup after loading the view. +} + +/* +#pragma mark - Navigation + +// In a storyboard-based application, you will often want to do a little preparation before navigation +- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { + // Get the new view controller using [segue destinationViewController]. + // Pass the selected object to the new view controller. +} +*/ + +@end diff --git a/keyBoard/KeyBoardPrefixHeader.pch b/keyBoard/KeyBoardPrefixHeader.pch index 0842fc8..eb4f669 100644 --- a/keyBoard/KeyBoardPrefixHeader.pch +++ b/keyBoard/KeyBoardPrefixHeader.pch @@ -16,6 +16,9 @@ /// 三方 #import +/// 项目 +#import "BaseNavigationController.h" + #endif /* KeyBoardPrefixHeader_pch */