问题
Can you disable 3rd party keyboards in iOS?
If so, how?
回答1:
Add this method to your UIApplicationDelegate
-(BOOL)application:(UIApplication *)application shouldAllowExtensionPointIdentifier:(NSString *)extensionPointIdentifier
{
if (extensionPointIdentifier == UIApplicationKeyboardExtensionPointIdentifier)
{
return NO;
}
return YES;
}
回答2:
Swift 5.1
Add to AppDelegate.Swift:
func application(application: UIApplication, shouldAllowExtensionPointIdentifier extensionPointIdentifier: String) -> Bool {
if (extensionPointIdentifier == UIApplication.ExtensionPointIdentifier.keyboard.rawValue) {
return false
}
return true
}
来源:https://stackoverflow.com/questions/28108659/how-do-you-disable-a-3rd-party-keyboard-in-your-ios-app