CreationKit Documentation

Class Ranged​Date​Input​Form​Layout

public final class RangedDateInputFormLayout: LabelInputFormLayout  

A LabelInputFormLayout subclass that uses a DateInputFormLayout for user input. This is similar to the DateInputFormLayout, but is used in cases where the use needs Ranged Selected on the DatePicker.

RangedDateInputFormLayout RangedDateInputFormLayout LabelInputFormLayout LabelInputFormLayout RangedDateInputFormLayout->LabelInputFormLayout

Superclass

LabelInputFormLayout

A layout used in forms for gathering input from a user.

Initializers

init()

required public init()  

Properties

selected​Dates​Publisher

public var selectedDatesPublisher: AnyPublisher<[Date]?, Never>  

The currently selected date, if there is one, as a Publisher.

selected​Dates

public var selectedDates: [Date]?  

The selected dates

selected​Range​String

public var selectedRangeString: String?  

The string displayed

date​Format

public var dateFormat: String = "MM/dd/yyyy"  

The date format to use in the date formatter. Used to display the selected date in the field.

Methods

select​Dates(_:​)

public func selectDates(_ dates: [Date])  

Sets the field to have a selected dates. This method is useful when you want to have the field default to a value.

This validates that the date passed in exists in the items property. If it does not, this does nothing.

Parameters

dates [Date]

The date that should be selected.

present​Date​Picker(presenter:​date​Config:​did​Select​Dates:​)

public func presentDatePicker(
    presenter: UIViewController,
    dateConfig: DatePickerConfiguration,
    didSelectDates: @escaping ([Date]?) -> Void
  )  

Call this method when you want to show the DatePicker, i.e when the view is tapped.

This will make the picker and then present it for you as a ModalDialog.

Parameters

presenter UIView​Controller

The UIViewController to use to present the DatePicker.

date​Config Date​Picker​Configuration

The configuration object to use to configure the DatePicker.

did​Select​Dates @escaping ([Date]?) -> Void

Closure to pass the selected dates object.