Post

Replies

Boosts

Views

Created

DatePicker Without Default Date?
I'm using a DatePicker(_:selection:displayedComponents:) to allow the user to set when they finished watching/reading a show. In my case, setting the date to the current date may be confusing as the user is not required to set one, so I'd like to not fill it in so it's like a placeholder. The selection parameter requires a Binding<Date>, but I'd like to use it like Binding<Date?>. How could I accomplish this?
1
3
1.4k
Dec ’20