Skip to content

Latest commit

 

History

History
62 lines (39 loc) · 998 Bytes

README.md

File metadata and controls

62 lines (39 loc) · 998 Bytes

DatePicker

struct ContentView: View {
    
    @State private var wakeUp = Date()
    
    var body: some View {
    
        DatePicker("Please enter a date", selection: $wakeUp)
    }
    
}

Form {
    DatePicker("Please enter a date", selection: $wakeUp)
}

DatePicker("Please enter a date", selection: $wakeUp)
        .labelsHidden()

hourAndMinute

DatePicker("", selection: $wakeUp, displayedComponents: .hourAndMinute)

date

DatePicker("", selection: $wakeUp, displayedComponents: .date)

range

All the dates in the future, but none in the past.

DatePicker("Please enter a date", selection: $wakeUp, in: Date()...)

Links that help