Last active
April 18, 2019 09:06
-
-
Save hanfengs/072c2c7c4eb6933dd294016d94f139eb to your computer and use it in GitHub Desktop.
[强制使用系统键盘] 强制使用系统键盘 #keyboard
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//https://www.cnblogs.com/syios/p/7692566.html | |
//https://www.jianshu.com/p/35219655d187 | |
-(BOOL)application:(UIApplication *)application shouldAllowExtensionPointIdentifier:(UIApplicationExtensionPointIdentifier)extensionPointIdentifier{ | |
// 整个app应用内禁用第三方键盘 | |
// if ([extensionPointIdentifier isEqualToString:@"com.apple.keyboard-service"]) { | |
// return NO; | |
// } | |
// 指定页面禁用第三方键盘 | |
for (UIViewController *vc in self.window.rootViewController.childViewControllers) { | |
if ([vc isKindOfClass:NSClassFromString(@"TSBaseNavigationController")]) { | |
for (UIViewController *obj in vc.childViewControllers) { | |
if ([obj isKindOfClass:NSClassFromString(@"TSSentencePracticeViewController")] || [obj isKindOfClass:NSClassFromString(@"TSWordPractice3ViewController")]) { | |
return NO; | |
} | |
} | |
} | |
} | |
return YES; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment