0

I'm developing a custom keyboard for iOS 8, and I need to get keyboard language code, i.e "en-US","es-ES" etc. These codes are set in Info.plist file for each extension, in NSExtensionAttributes dictionary (see attached image). How to get programmatically NSExtensionAttributes dictionary?

enter image description here

iOS Dev
  • 4,143
  • 5
  • 30
  • 58

1 Answers1

0

I've found the following solution:

NSDictionary *infoDict = [[NSBundle mainBundle] infoDictionary];
NSDictionary *extentionDictionary = infoDict[@"NSExtension"];
NSDictionary *extentionAttributesDictionary = extentionDictionary[@"NSExtensionAttributes"];
NSString *languageCode = extentionAttributesDictionary[@"PrimaryLanguage"];
iOS Dev
  • 4,143
  • 5
  • 30
  • 58