diff --git a/keyBoard.xcodeproj/project.pbxproj b/keyBoard.xcodeproj/project.pbxproj index 556c9fa..3ff85de 100644 --- a/keyBoard.xcodeproj/project.pbxproj +++ b/keyBoard.xcodeproj/project.pbxproj @@ -911,7 +911,7 @@ CODE_SIGN_ENTITLEMENTS = CustomKeyboard/CustomKeyboard.entitlements; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; - DEVELOPMENT_TEAM = TN6HHV45BB; + DEVELOPMENT_TEAM = UFX79H8H66; ENABLE_USER_SCRIPT_SANDBOXING = NO; GCC_PREFIX_HEADER = CustomKeyboard/PrefixHeader.pch; GCC_PREPROCESSOR_DEFINITIONS = ( @@ -929,7 +929,7 @@ "@executable_path/../../Frameworks", ); MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.keyBoardst.CustomKeyboard; + PRODUCT_BUNDLE_IDENTIFIER = com.loveKey.nyx.CustomKeyboard; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; SWIFT_EMIT_LOC_STRINGS = YES; @@ -944,7 +944,7 @@ CODE_SIGN_ENTITLEMENTS = CustomKeyboard/CustomKeyboard.entitlements; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; - DEVELOPMENT_TEAM = TN6HHV45BB; + DEVELOPMENT_TEAM = UFX79H8H66; ENABLE_USER_SCRIPT_SANDBOXING = NO; GCC_PREFIX_HEADER = CustomKeyboard/PrefixHeader.pch; GCC_PREPROCESSOR_DEFINITIONS = ( @@ -962,7 +962,7 @@ "@executable_path/../../Frameworks", ); MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.keyBoardst.CustomKeyboard; + PRODUCT_BUNDLE_IDENTIFIER = com.loveKey.nyx.CustomKeyboard; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; SWIFT_EMIT_LOC_STRINGS = YES; @@ -977,9 +977,10 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_ENTITLEMENTS = keyBoard/keyBoard.entitlements; + CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; - DEVELOPMENT_TEAM = TN6HHV45BB; + DEVELOPMENT_TEAM = UFX79H8H66; GCC_PREFIX_HEADER = keyBoard/KeyBoardPrefixHeader.pch; GCC_PREPROCESSOR_DEFINITIONS = ( "$(inherited)", @@ -1000,8 +1001,9 @@ "@executable_path/Frameworks", ); MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.keyBoardst; + PRODUCT_BUNDLE_IDENTIFIER = com.loveKey.nyx; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; STRING_CATALOG_GENERATE_SYMBOLS = YES; SWIFT_EMIT_LOC_STRINGS = YES; TARGETED_DEVICE_FAMILY = "1,2"; @@ -1015,9 +1017,10 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_ENTITLEMENTS = keyBoard/keyBoard.entitlements; + CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; - DEVELOPMENT_TEAM = TN6HHV45BB; + DEVELOPMENT_TEAM = UFX79H8H66; GCC_PREFIX_HEADER = keyBoard/KeyBoardPrefixHeader.pch; GCC_PREPROCESSOR_DEFINITIONS = ( "$(inherited)", @@ -1038,8 +1041,9 @@ "@executable_path/Frameworks", ); MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.keyBoardst; + PRODUCT_BUNDLE_IDENTIFIER = com.loveKey.nyx; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; STRING_CATALOG_GENERATE_SYMBOLS = YES; SWIFT_EMIT_LOC_STRINGS = YES; TARGETED_DEVICE_FAMILY = "1,2"; diff --git a/keyBoard/Class/Base/VC/BaseNavigationController.m b/keyBoard/Class/Base/VC/BaseNavigationController.m index 3d55ecb..7e12afe 100644 --- a/keyBoard/Class/Base/VC/BaseNavigationController.m +++ b/keyBoard/Class/Base/VC/BaseNavigationController.m @@ -18,13 +18,11 @@ // 统一返回箭头样式与颜色 UIImage *backImg = [UIImage imageNamed:@"back_black_icon"]; if (backImg) { - // 使用自定义返回指示图标;mask 用同一张图片 self.navigationBar.backIndicatorImage = backImg; self.navigationBar.backIndicatorTransitionMaskImage = backImg; } self.navigationBar.tintColor = [UIColor blackColor]; // 箭头/按钮的着色 - // iOS 14+ 可以统一隐藏返回标题,避免出现“首页”字样 if (@available(iOS 14.0, *)) { self.navigationBar.topItem.backButtonDisplayMode = UINavigationItemBackButtonDisplayModeMinimal; } @@ -33,7 +31,6 @@ - (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated{ if (self.viewControllers.count > 0) { viewController.hidesBottomBarWhenPushed = true; - // 隐藏上一页提供的返回标题(如“首页”),只保留箭头 UIViewController *prev = self.topViewController; if (@available(iOS 14.0, *)) { prev.navigationItem.backButtonDisplayMode = UINavigationItemBackButtonDisplayModeMinimal; diff --git a/keyBoard/Class/Home/VC/HomeVC.m b/keyBoard/Class/Home/VC/HomeVC.m index dee9fac..346f4b4 100644 --- a/keyBoard/Class/Home/VC/HomeVC.m +++ b/keyBoard/Class/Home/VC/HomeVC.m @@ -11,7 +11,7 @@ @interface HomeVC () @property (nonatomic, strong) UITextView *textView; // 作为表头,保持原有键盘测试 -@property (nonatomic, strong) UITableView *tableView; // 首页列表 +@property (nonatomic, strong) BaseTableView *tableView; // 首页列表 @property (nonatomic, copy) NSArray *items; // 简单数据源 @end @@ -21,7 +21,6 @@ [super viewDidLoad]; self.view.backgroundColor = [UIColor whiteColor]; - // 表头中的文本输入框:保留原有键盘测试能力 CGFloat width = [UIScreen mainScreen].bounds.size.width; UIView *header = [[UIView alloc] initWithFrame:CGRectMake(0, 0, width, 220)]; CGRect frame = CGRectMake(16, 16, width - 32, 188); @@ -32,20 +31,17 @@ [header addSubview:self.textView]; // 列表 - self.tableView = [[UITableView alloc] initWithFrame:self.view.bounds style:UITableViewStyleInsetGrouped]; + self.tableView = [[BaseTableView alloc] initWithFrame:self.view.bounds style:UITableViewStyleInsetGrouped]; self.tableView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; self.tableView.delegate = self; self.tableView.dataSource = self; self.tableView.tableHeaderView = header; [self.view addSubview:self.tableView]; - // 数据(第一个:语言测试;第二个:键盘权限引导) self.items = @[ KBLocalized(@"home_item_lang_test"), KBLocalized(@"home_item_keyboard_permission") ]; - // 首次进入,聚焦到输入框方便测试键盘 dispatch_async(dispatch_get_main_queue(), ^{ [self.textView becomeFirstResponder]; }); - // 可选:示例网络请求(保持原逻辑) [[KBNetworkManager shared] GET:@"app/config" parameters:nil headers:nil completion:^(id _Nullable jsonOrData, NSURLResponse * _Nullable response, NSError * _Nullable error) { NSLog(@"===="); }]; @@ -53,9 +49,7 @@ - (void)viewWillAppear:(BOOL)animated{ [super viewWillAppear:animated]; - // 刷新本页涉及的多语言文案 self.title = KBLocalized(@"home_title"); - // 重建 items 以更新本地化的 cell 标题 self.items = @[ KBLocalized(@"home_item_lang_test"), KBLocalized(@"home_item_keyboard_permission") ]; [self.tableView reloadData]; } diff --git a/keyBoard/Class/Home/VC/KBLangTestVC.m b/keyBoard/Class/Home/VC/KBLangTestVC.m index b743b56..0c212c1 100644 --- a/keyBoard/Class/Home/VC/KBLangTestVC.m +++ b/keyBoard/Class/Home/VC/KBLangTestVC.m @@ -1,6 +1,5 @@ // // KBLangTestVC.m -// 多语言测试页:点击切换语言(在 zh-Hans 与 en 之间),演示运行时生效。 // #import "KBLangTestVC.h" diff --git a/keyBoard/Class/Login/VC/KBLoginSheetViewController.h b/keyBoard/Class/Login/VC/KBLoginSheetViewController.h index 101a497..2f65a49 100644 --- a/keyBoard/Class/Login/VC/KBLoginSheetViewController.h +++ b/keyBoard/Class/Login/VC/KBLoginSheetViewController.h @@ -11,10 +11,8 @@ NS_ASSUME_NONNULL_BEGIN @interface KBLoginSheetViewController : UIViewController -/// Called when the login finished successfully; sheet will dismiss itself as well. @property (nonatomic, copy, nullable) void (^onLoginSuccess)(void); -/// Present the sheet from a top most view controller. + (void)presentIfNeededFrom:(UIViewController *)presenting; @end diff --git a/keyBoard/Class/Login/VC/KBLoginSheetViewController.m b/keyBoard/Class/Login/VC/KBLoginSheetViewController.m index a4b69fa..04b6629 100644 --- a/keyBoard/Class/Login/VC/KBLoginSheetViewController.m +++ b/keyBoard/Class/Login/VC/KBLoginSheetViewController.m @@ -35,7 +35,6 @@ } - (void)buildUI { - // 半透明背景,点击可关闭 self.backdrop = [[UIControl alloc] init]; self.backdrop.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.15]; [self.backdrop addTarget:self action:@selector(dismissSelf) forControlEvents:UIControlEventTouchUpInside]; @@ -44,11 +43,9 @@ make.edges.equalTo(self.view); }]; - // 底部白色卡片 self.sheet = [[UIView alloc] init]; self.sheet.backgroundColor = [UIColor whiteColor]; self.sheet.layer.cornerRadius = 12.0; - self.sheet.layer.maskedCorners = kCALayerMinXMinYCorner | kCALayerMaxXMinYCorner; // 顶部圆角 self.sheet.layer.masksToBounds = YES; [self.view addSubview:self.sheet]; [self.sheet mas_makeConstraints:^(MASConstraintMaker *make) { @@ -57,7 +54,6 @@ make.height.mas_equalTo(160); }]; - // 复选框 + 文案 self.checkButton = [UIButton buttonWithType:UIButtonTypeSystem]; self.checkButton.layer.cornerRadius = 16; self.checkButton.layer.borderWidth = 2; @@ -84,7 +80,6 @@ make.right.lessThanOrEqualTo(self.sheet).offset(-20); }]; - // Continue 按钮 self.continueButton = [UIButton buttonWithType:UIButtonTypeSystem]; self.continueButton.backgroundColor = [UIColor whiteColor]; self.continueButton.layer.cornerRadius = 10; @@ -136,12 +131,10 @@ } - (void)onContinue { - // 继续:展示内置的登录页(Apple 登录) LoginViewController *login = [LoginViewController new]; __weak typeof(self) weakSelf = self; login.onLoginSuccess = ^(NSDictionary * _Nonnull userInfo) { __strong typeof(weakSelf) self = weakSelf; if (!self) return; - // 先关闭登录页,再收起底部弹层 [self dismissViewControllerAnimated:YES completion:^{ if (self.onLoginSuccess) self.onLoginSuccess(); [self dismissSelf]; diff --git a/keyBoard/Class/Login/VC/LoginViewController.m b/keyBoard/Class/Login/VC/LoginViewController.m index 5189830..7d4fc9a 100644 --- a/keyBoard/Class/Login/VC/LoginViewController.m +++ b/keyBoard/Class/Login/VC/LoginViewController.m @@ -13,7 +13,7 @@ @property (nonatomic, strong) UILabel *titleLabel; // Apple 登录按钮容器(懒加载) @property (nonatomic, strong) UIView *appleContainer; -// iOS13+ 的 Apple 登录按钮(懒加载) +// Apple 登录按钮(懒加载) @property (nonatomic, strong) ASAuthorizationAppleIDButton *appleButton API_AVAILABLE(ios(13.0)); // iOS13 以下的占位按钮(懒加载) @property (nonatomic, strong) UIButton *compatHintButton; diff --git a/keyBoard/Info.plist b/keyBoard/Info.plist index 91491f9..6ab2b09 100644 --- a/keyBoard/Info.plist +++ b/keyBoard/Info.plist @@ -2,21 +2,21 @@ + CFBundleURLTypes + + + CFBundleURLName + com.keyBoardst.keyboard + CFBundleURLSchemes + + kbkeyboard + + + NSAppTransportSecurity NSAllowsArbitraryLoads - CFBundleURLTypes - - - CFBundleURLName - com.keyBoardst.keyboard - CFBundleURLSchemes - - kbkeyboard - - -