初始项目2
This commit is contained in:
@@ -11,28 +11,11 @@
|
||||
#import <AFNetworking/AFNetworking.h>
|
||||
#import <Bugly/Bugly.h>
|
||||
static NSString * const kKBKeyboardExtensionBundleId = @"com.keyBoard.CustomKeyboard";
|
||||
static BOOL KBIsKeyboardEnabled(void) {
|
||||
for (UITextInputMode *mode in [UITextInputMode activeInputModes]) {
|
||||
NSString *identifier = nil;
|
||||
@try {
|
||||
identifier = [mode valueForKey:@"identifier"]; // not a public API
|
||||
} @catch (__unused NSException *e) {
|
||||
identifier = nil;
|
||||
}
|
||||
if ([identifier isKindOfClass:[NSString class]] &&
|
||||
[identifier rangeOfString:kKBKeyboardExtensionBundleId].location != NSNotFound) {
|
||||
return YES;
|
||||
}
|
||||
}
|
||||
return NO;
|
||||
}
|
||||
|
||||
|
||||
@implementation AppDelegate
|
||||
|
||||
|
||||
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
|
||||
// Override point for customization after application launch.
|
||||
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
|
||||
self.window.backgroundColor = [UIColor whiteColor];
|
||||
[self.window makeKeyAndVisible];
|
||||
@@ -40,7 +23,11 @@ static BOOL KBIsKeyboardEnabled(void) {
|
||||
self.window.rootViewController = vc;
|
||||
/// 获取网络权限
|
||||
[self getNetJudge];
|
||||
[Bugly startWithAppId:BuglyId];
|
||||
/// Bugly
|
||||
BuglyConfig *buglyConfig = [BuglyConfig new];
|
||||
/// 设置GroupID进行配置
|
||||
// buglyConfig.applicationGroupIdentifier = @"";
|
||||
[Bugly startWithAppId:BuglyId config:buglyConfig];
|
||||
/// 判断获取键盘权限
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[self kb_presentPermissionIfNeeded];
|
||||
@@ -95,4 +82,22 @@ static BOOL KBIsKeyboardEnabled(void) {
|
||||
}];
|
||||
}
|
||||
|
||||
|
||||
static BOOL KBIsKeyboardEnabled(void) {
|
||||
for (UITextInputMode *mode in [UITextInputMode activeInputModes]) {
|
||||
NSString *identifier = nil;
|
||||
@try {
|
||||
identifier = [mode valueForKey:@"identifier"]; // not a public API
|
||||
} @catch (__unused NSException *e) {
|
||||
identifier = nil;
|
||||
}
|
||||
if ([identifier isKindOfClass:[NSString class]] &&
|
||||
[identifier rangeOfString:kKBKeyboardExtensionBundleId].location != NSNotFound) {
|
||||
return YES;
|
||||
}
|
||||
}
|
||||
return NO;
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user