DatePicker

public struct DatePicker : View
extension DatePicker: Renderable

A view that displays a wheel-style date picker that allows selecting a date in the range.

  • Declaration

    Swift

    public var viewStore: ViewValues
  • Declaration

    Swift

    public enum DatePickerComponent
  • Declaration

    Swift

    public typealias Components = [DatePickerComponent]
  • Declaration

    Swift

    public var body: View { get }
  • Creates an instance that selects a date from within a range.

    Declaration

    Swift

    public init(_ title: String, selection: Binding<Date>, in range: ClosedRange<Date>, displayedComponents: Components)

    Parameters

    title

    The title of view. We don’t support it now. just keep it so we can have same format as swiftUI’s DatePicker.

    selection

    The selected date within range.

    range

    The close range of the valid dates.

    displayedComponents

    The time components that composite the date picker, now only supports [date, hourAndMinute], [date], [hourAndMinute].

  • Creates an instance that selects a date from within a range.

    Declaration

    Swift

    public init(_ title: String, selection: Binding<Date>, in range: PartialRangeFrom<Date>, displayedComponents: Components)

    Parameters

    title

    The title of view. We don’t support it now. just keep it so we can have same format as swiftUI’s DatePicker.

    selection

    The selected date within range.

    range

    The partial range of the valid dates.

    displayedComponents

    The time components that composite the date picker, now only supports [date, hourAndMinute], [date], [hourAndMinute].

  • Declaration

    Swift

    public func createView(context: Context) -> UIView
  • Declaration

    Swift

    public func updateView(_ view: UIView, context: Context)