I am trying to set the date of birth DatePicker to allow a user to set it once and then it becomes locked.
I thought I would do an if statement however apparently DatePicker() does not allow .if()
So I thought I would try the following below.
However I am getting the following issue.
No exact matches in call to initializer
Now the default of DOB its set to todays date.
The goal is to make this section
DatePicker(LocalizedStringKey("Date"),selection: $userSettings.dateofbirth,in: ...Date(), displayedComponents: .date)
be only changed once.