I have a language selection control in my application, and I want to be able to set the locale accordingly during runtime. How can I achieve this?
I found the answer
NSUserDefaults.standardUserDefaults().setObject(["fr"], forKey: "AppleLanguages")
NSUserDefaults.standardUserDefaults().synchronize()
Swift 3:
UserDefaults.standard.set(["fr"], forKey: "AppleLanguages")
UserDefaults.standard.synchronize()
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments