Forcing app to use Apple Keyboard in iOS 8

前端 未结 3 1337
一整个雨季
一整个雨季 2020-12-30 12:37

How can I get my app\'s UITextfields to only use the Apple keyboard in iOS 8? I do not want to allow third party keyboards, period. I understand it may be bad user experienc

3条回答
  •  情书的邮戳
    2020-12-30 13:13

    Apple provides an API for exactly that. Put this in your AppDelegate

    - (BOOL)application:(UIApplication *)application
    shouldAllowExtensionPointIdentifier:(NSString *)extensionPointIdentifier
    {
        if ([extensionPointIdentifier isEqualToString:@"com.apple.keyboard-service"]) {
            return NO;
        }
        return YES;
    }
    

    This is the cleanest and documented way to do it :)

提交回复
热议问题