CPCCalendarViewSelectionDelegate

public protocol CPCCalendarViewSelectionDelegate : AnyObject

Use a selection delegate (a custom object that implements this protocol) to modify behavior of a calendar view when user interacts with it.

  • Selected days associated with this view.

    Declaration

    Swift

    var selection: CPCViewSelection { get set }
  • Tells the delegate that a specific cell is about to be selected by user.

    The delegate must updated stored selection value according to the desired selection scheme and return whether the resulting selection was somehow changed.

    Declaration

    Swift

    func calendarView(_ calendarView: CPCCalendarView, shouldSelect day: CPCDay) -> Bool

    Parameters

    calendarView

    View to handle user interaction for.

    day

    Day value rendered by the interacted cell.

    Return Value

    true if user actions have lead to an updated selection value; otherwise, false.

  • Tells the delegate that a specific cell is about to be deselected by user.

    The delegate must updated stored selection value according to the desired selection scheme and return whether the resulting selection was somehow changed.

    Declaration

    Swift

    func calendarView(_ calendarView: CPCCalendarView, shouldDeselect day: CPCDay) -> Bool

    Parameters

    calendarView

    View to handle user interaction for.

    day

    Day value rendered by the interacted cell.

    Return Value

    true if user actions have lead to an updated selection value; otherwise, false.