Good morning to everyone, I have a trouble with storage of Date() format.
I wrote this code and I convert Date() as a string in a swift file with string array:
var dayOfRecord = Date() var dataOK: String { return DateFormatter.localizedString(from: dayOfRecord, dateStyle: .short, timeStyle: .none) }
In another swift file (AddView) I wrote this code: DatePicker("", selection: $dayOfRecord, displayedComponents: .date)
Now I have to store this information in an array of other strings but return an error: Cannot find '$dayOfRecord' in scope
Where is my error? Thanks!