init(selection:displayedComponents:label:)
Creates an instance that selects a Date with an unbounded range.
Declaration
nonisolated init(selection: Binding<Date>, displayedComponents: DatePicker<Label>.Components = [.hourAndMinute, .date], @ViewBuilder label: () -> Label)Parameters
- selection:
The date value being displayed and selected.
- displayedComponents:
The date components that user is able to view and edit. Defaults to
[.hourAndMinute, .date]. On watchOS, if.hourAndMinuteor.hourMinuteAndSecondare included with.date, only.dateis displayed. - label:
A view that describes the use of the date.