Skip to content

Instantly share code, notes, and snippets.

@hanfengs hanfengs/delegate.m
Last active Apr 18, 2019

Embed
What would you like to do?
[强制使用系统键盘] 强制使用系统键盘 #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
You can’t perform that action at this time.