I have a reset function that sets an empty string for every key in UserDefaults.standard
but it isn't actually resetting them, sometimes it works, sometimes it doesn't, and the weird thing is that sometimes it reset only a few values.
There's nothing that could set the previous values because the reset function once the values are reset, exit the application.
@IBAction func reset(_ sender: Any) {
//(userDefaults = UserDefaults.standard)
userDefaults.set("", forKey: "ident")
userDefaults.set("", forKey: "usr")
userDefaults.set("", forKey: "psw")
userDefaults.set("", forKey: "token")
userDefaults.set("", forKey: "release")
userDefaults.set("", forKey: "expire")
userDefaults.set("", forKey: "name")
userDefaults.set("", forKey: "surname")
userDefaults.set("", forKey: "ident_req")
print(userDefaults.string(forKey: "ident")) //output: Optional("")
exit(1)
}
What should I do??