fixUI
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
#import "LoginViewController.h"
|
||||
#import "KBLoginSheetViewController.h"
|
||||
#import "AppleSignInManager.h"
|
||||
#import <objc/message.h>
|
||||
|
||||
// 注意:用于判断系统已启用本输入法扩展的 bundle id 需与扩展 target 的
|
||||
// PRODUCT_BUNDLE_IDENTIFIER 完全一致。
|
||||
@@ -34,9 +35,23 @@ static NSString * const kKBKeyboardExtensionBundleId = @"com.keyBoardst.CustomKe
|
||||
/// 设置GroupID进行配置
|
||||
// buglyConfig.applicationGroupIdentifier = @"";
|
||||
[Bugly startWithAppId:BuglyId config:buglyConfig];
|
||||
/// 判断获取键盘权限
|
||||
/// 判断获取键盘权限(统一管理):
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[self kb_presentPermissionIfNeeded];
|
||||
UIViewController *top = [self kb_topMostViewController];
|
||||
if (top) {
|
||||
Class mgrCls = NSClassFromString(@"KBKeyboardPermissionManager");
|
||||
if (mgrCls && [mgrCls respondsToSelector:@selector(shared)]) {
|
||||
id mgr = [mgrCls performSelector:@selector(shared)];
|
||||
if ([mgr respondsToSelector:@selector(presentPermissionIfNeededFrom:)]) {
|
||||
// 避免私有 API 静态链接,运行时调用
|
||||
void (*func)(id, SEL, UIViewController *) = (void (*)(id, SEL, UIViewController *))objc_msgSend;
|
||||
func(mgr, @selector(presentPermissionIfNeededFrom:), top);
|
||||
}
|
||||
} else {
|
||||
// 兜底走原有逻辑(仅判断是否启用键盘)
|
||||
[self kb_presentPermissionIfNeeded];
|
||||
}
|
||||
}
|
||||
});
|
||||
return YES;
|
||||
}
|
||||
|
||||
15
keyBoard/Class/Categories/UIViewController+Extension.h
Normal file
15
keyBoard/Class/Categories/UIViewController+Extension.h
Normal file
@@ -0,0 +1,15 @@
|
||||
//
|
||||
// UIViewController+Extension.h
|
||||
// keyBoard
|
||||
//
|
||||
// Created by Mac on 2025/11/3.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface UIViewController (Extension)
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
12
keyBoard/Class/Categories/UIViewController+Extension.m
Normal file
12
keyBoard/Class/Categories/UIViewController+Extension.m
Normal file
@@ -0,0 +1,12 @@
|
||||
//
|
||||
// UIViewController+Extension.m
|
||||
// keyBoard
|
||||
//
|
||||
// Created by Mac on 2025/11/3.
|
||||
//
|
||||
|
||||
#import "UIViewController+Extension.h"
|
||||
|
||||
@implementation UIViewController (Extension)
|
||||
|
||||
@end
|
||||
@@ -35,8 +35,8 @@
|
||||
// KBGuideVC *vc = [[KBGuideVC alloc] init];
|
||||
// [self.navigationController pushViewController:vc animated:true];
|
||||
// [KBHUD showInfo:@"加载中..."];
|
||||
[KBHUD show];
|
||||
[KBHUD showAllowTapToDismiss:true];
|
||||
// [KBHUD show];
|
||||
// [KBHUD showAllowTapToDismiss:true];
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user