How to determine which user keyboard (ios 8) is currently used to enter text

I am using this solution ( https://stackoverflow.com/a/312947/ ) to detect all user 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 is not enough for my project - I need to know which user keyboard is selected by the user to enter text. I have a study on stackoverflow and other resources, but no solutions have been found for this. Is there a way to detect in my application which user keyboard is currently selected for text input?

Thanks!

+5
source share
1 answer

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; } 

Perhaps you can change the UIApplicationKeyboardExtensionPointIdentifier value to suit your needs

-1
source

Source: https://habr.com/ru/post/1208939/


All Articles