I have this DatePicker inside a VStack, working fine:
VStack {
DatePicker(selection: $birthDate, displayedComponents: .date) {
Text("")
}.padding(10)
.labelsHidden()
.datePickerStyle(WheelDatePickerStyle())
}
I'd like to be able to have the default date set to 40 years in the past so the user doesn't have to spin the year so far (most people aren't newborns). This can be done with DatePicker as shown in this SO answer. I don't know how to implement that in SwiftUI. Thanks for any help.