8

I am using this solution (https://stackoverflow.com/a/25786928) to detect all custom keyboards activated in Settins app (iOS 8):

- (void)printoutAllActiveKeyboards {
   // Array of all active keyboards
   NSArray *keyboards = [[[NSUserDefaults standardUserDefaults] dictionaryRepresentation] objectForKey:@"AppleKeyboards"]; 
   for (NSString *keyboard in keyboards)
      NSLog(@"Custom keyboard: %@", keyboard);
}

But this in not enough for my project - I need to know which custom keyboard is currently chosen by the user for text entering. I have research stackoverflow and other resources but not found any solution for this. Is there any way to detect in my app which custom keyboard in currently chosen for text entering?

Thank you!

Community
  • 1
  • 1
  • 1
    Not sure if this is question is still relevant for you today, but for anybody else who comes over this question, there is a solution that still works in 2018 here: https://stackoverflow.com/a/26368224/7349426 – JohnV Jul 25 '18 at 19:10

1 Answers1

-2

Take a look at this UIApplication API method to disable custom keyboards:

- (BOOL)application:(UIApplication *)application shouldAllowExtensionPointIdentifier:(NSString *)extensionPointIdentifier {
    if ([extensionPointIdentifier isEqualToString: UIApplicationKeyboardExtensionPointIdentifier]) {
         return NO;
    }
    return YES;
}

Maybe you can modify the value of UIApplicationKeyboardExtensionPointIdentifier to match your needs

nurnachman
  • 4,468
  • 2
  • 37
  • 40