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?
Asked
Active
Viewed 952 times
0

iOS Dev
- 4,143
- 5
- 30
- 58
-
See https://stackoverflow.com/questions/9530075/ios-access-app-info-plist-variables-in-code – Dan Loewenherz Dec 26 '14 at 14:35
1 Answers
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