DatePickerComponents2
The date and time components that a date picker shows.
Declaration
type DatePickerComponents2 =
| ('date'
| 'hourAndMinute'
| { rawValue: number; })
| readonly ('date'
| 'hourAndMinute'
| { rawValue: number; })[];struct DatePickerComponentsPass a literal, or build one with SwiftUI.DatePickerComponents2 from import { SwiftUI } from 'swiftui-react-native'.
Overview
Pass a value of this type as the displayedComponents argument of a
DatePicker initializer to choose which parts of a date someone can
edit. Combine options to show more than one group.
DatePicker(
"Departure",
selection: $departure,
displayedComponents: [.hourAndMinute, .date]
)A picker shows [.hourAndMinute, .date] unless you choose otherwise. Each
option respects the current locale, so DatePickerComponents.date orders
the day, month, and year the way the person's region expects.
From Apple’s SwiftUI documentation. Code samples there are Swift.
See also
More in Other values.
- AxisThe horizontal or vertical dimension in a 2D coordinate system.
- AxisSetAn efficient set of axes.
- ButtonRoleA value that describes the purpose of a button.
- CapsuleA capsule shape aligned inside the frame of the view containing it.
- CircleA circle centered on the frame of the view containing it.
- ConcentricRectangleA shape whose corners you configure, individually or uniformly, to be squared, rounded, or concentric relative to a container shape's corners.
- ContentMarginGuideA guide for resolving the content margins for a view.
- ContentMarginPlacementThe placement of margins.
- ContentModeConstants that define how a view's content fills the available space.
- DatePickerComponents
- DeviceHingeA type encapsulating the state of a single hinge.
- DeviceHingeContextA type describing the context of hinges on the device.