iOS get the the language of the device swift
Solution:
If you want to find the language selected on the device use the below code.
objective c:
NSString *lang = [[[NSBundle mainBundle] preferredLocalizations] objectAtIndex:0];
If you want to find the language selected on the device use the below code.
objective c:
NSString *lang = [[[NSBundle mainBundle] preferredLocalizations] objectAtIndex:0];
Swift:
let lang = NSBundle.mainBundle().preferredLocalizations.first as! NSString
Comments
Post a Comment