I am trying to implement a function that can change app language.
I tried to set it like this:
let defaults = NSUserDefaults.standardUserDefaults()
defa
Updated Swift syntax of the main.swift file mentioned in @royherma's answer. This will avoid having to restart the app after overriding the UserDefaults settings:
import Foundation
import UIKit
// Your initialization code here
let langCultureCode: String = "LANGUAGE_CODE"
UserDefaults.standard.set([langCultureCode], forKey: "AppleLanguages")
UserDefaults.standard.synchronize()
UIApplicationMain(CommandLine.argc, CommandLine.unsafeArgv, nil, NSStringFromClass(AppDelegate.self))
paired together with the removal of @UIApplicationMain in your AppDelegate.swift file.