DateItem

public class DateItem : RVS_CalendarInputDateItemProtocol

This is one element of the data that is provided to, and read from, the view.

This is a class, as opposed to a struct, because we rely on reference semantics to set and get state.

Required Stored Properties

  • The year, as an integer. REQUIRED

    Declaration

    Swift

    public var year: Int
  • The month, as an integer (1 -> 12). REQUIRED

    Declaration

    Swift

    public var month: Int
  • day

    The day of the month (1 -> [28|29|30|31]), as an integer. REQUIRED

    Declaration

    Swift

    public var day: Int

Optional Stored Properties

  • True, if the item is enabled for selection. Default is false. OPTIONAL

    Declaration

    Swift

    public var isEnabled: Bool
  • True, if the item is currently selected. Default is false. OPTIONAL

    Declaration

    Swift

    public var isSelected: Bool
  • Reference context. This is how we attach arbitrary data to the item. OPTIONAL

    Declaration

    Swift

    public var refCon: Any?

Default Initializer

  • Default Initializer. The calendar used, will be the current one.

    Declaration

    Swift

    public init(day inDay: Int,
                month inMonth: Int,
                year inYear: Int,
                isEnabled inIsEnabled: Bool = false,
                isSelected inIsSelected: Bool = false,
                refCon inRefCon: Any? = nil
    )

    Parameters

    day

    The day of the month (1 -> [28|29|30|31]), as an integer. REQUIRED

    month

    The month, as an integer (1 -> 12). REQUIRED

    year

    The year, as an integer. REQUIRED

    isEnabled

    True, if the item is enabled for selection. Default is false. OPTIONAL

    isSelected

    True, if the item is currently selected. Default is false. OPTIONAL

    refCon

    Reference context. This is how we attach arbitrary data to the item. OPTIONAL

Convenience Initializers

  • DateComponents Initializer (can return nil)

    Declaration

    Swift

    public convenience init?(dateComponents inDateComponents: DateComponents,
                             isEnabled inIsEnabled: Bool = false,
                             isSelected inIsSelected: Bool = false,
                             calendar inCalendar: Calendar? = nil,
                             refCon inRefCon: Any? = nil
    )

    Parameters

    dateComponents

    The day/month/year, as DateComponents. The calendar used, will be the current one. REQUIRED

    isEnabled

    True, if the item is enabled for selection. Default is false. OPTIONAL

    isSelected

    True, if the item is currently selected. Default is false. OPTIONAL

    refCon

    Reference context. This is how we attach arbitrary data to the item. OPTIONAL

  • Date Initializer (can return nil)

    Declaration

    Swift

    public convenience init?(date inDate: Date,
                             isEnabled inIsEnabled: Bool = false,
                             isSelected inIsSelected: Bool = false,
                             calendar inCalendar: Calendar? = nil,
                             refCon inRefCon: Any? = nil
    )

    Parameters

    date

    The day/month/year, as a Date instance. The calendar used, will be the current one. REQUIRED

    isEnabled

    True, if the item is enabled for selection. Default is false. OPTIONAL

    isSelected

    True, if the item is currently selected. Default is false. OPTIONAL

    refCon

    Reference context. This is how we attach arbitrary data to the item. OPTIONAL