Skip to content

Instantly share code, notes, and snippets.

@hanfengs
Last active April 18, 2019 09:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hanfengs/072c2c7c4eb6933dd294016d94f139eb to your computer and use it in GitHub Desktop.
Save hanfengs/072c2c7c4eb6933dd294016d94f139eb to your computer and use it in GitHub Desktop.
[强制使用系统键盘] 强制使用系统键盘 #keyboard
//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