I need to change my app language tapping a button in my app. I've used NSLocalizedStrings
all around the app View Controllers and I already have Localizable.strings
file created with the translations inside.
What code should I use to change the language without restarting my app?
I've tried this but it's not working.
@IBAction func changeToSpanish(_ sender: Any) {
UserDefaults.standard.set("es", forKey: "i18n_language")
UserDefaults.standard.synchronize()
}