DatePickerWithCompactStyleType
@MainActor
public struct DatePickerWithCompactStyleType : IntrospectableViewType
An abstract representation of the DatePicker
type in SwiftUI, with .compact
style.
struct ContentView: View {
@State var date = Date()
var body: some View {
DatePicker("Pick a date", selection: $date)
.datePickerStyle(.compact)
.introspect(.datePicker(style: .compact), on: .iOS(.v14Later)) {
print(type(of: $0)) // UIDatePicker
}
}
}