swift4 获取系统语言

//判断系统选择的语言
func getLanguageType() -> String {
    let def = UserDefaults.standard
    let allLanguages: [String] = def.object(forKey: "AppleLanguages") as! [String]
    let chooseLanguage = allLanguages.first
    return chooseLanguage ?? "en"
}

你可能感兴趣的:(swift4 获取系统语言)