How to store date in userdefaults?
问题 I'd like to record the history of her entry into the textfield. I intend to register this with UserDefaults. But when I try to save it with UserDefaults, "cannot assign value of type 'nsdate'?'to type 'String' " Error. I don't think it's accepting textfield data because it's string. And how can I keep history in memory? formatteddate and formatteddate2 give this error. The date output is as follows : 20/04/2019 20:23 let token = try? keychain.getString("chipnumbernew") chip1InfoString = token