How I'm having problems with a small code ..
I am trying to save a String
with UserDefaults.standard
private static let KEY : String = "KEY"
private static let NOMBRE : String = "Usuario"
let prefs = UserDefaults.standard
prefs.setValue(NOMBRE, forKey: KEY)
print(prefs.string(forKey: KEY)!)
and the result of my print is nil
And I only have problems with Strings
Why can not I save a variable of type String
?