I am developing an app and started to implement UserDefaults. It wouldn't work so I tested my implementation in another app. It worked.
I have since, deleted the app from the simulator, restarted my computer, etc. It still doesn't work.
This code works in one app and not the other:
UserDefaults.standard.set("TEST", forKey: "test")
//does not work
let test = "TEST"
UserDefaults.standard.set(test, forKey: "test")
//does not work
UserDefaults.standard.set(test, forKey: "test")
UserDefaults.standard.synchronize()
//synchronize is legacy and not needed
//also does not work
Thanks so much for any help.