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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user