DatePicker Components
A date picker with only one displayed component
Platform Compatibility
iOS 13.0+ iPadOS 13.0+ macOS 10.15+ watchOS 10.0+ visionOS 1.0+
Tags
SwiftUI Code
@State var date = Date()
var body: some View {
VStack {
DatePicker("Select Date", selection: $date, displayedComponents: .date)
DatePicker("Select Date", selection: $date, displayedComponents: .hourAndMinute)
}
Found an issue or have a suggestion?
Created: June 4, 2025Updated: June 4, 2025