DatePickerWithCompactStyleType

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(.v14, .v15, .v16, .v17)) {
                print(type(of: $0)) // UIDatePicker
            }
    }
}
  • Undocumented

    See more

    Declaration

    Swift

    public enum Style