FUICalendarViewDelegate

public protocol FUICalendarViewDelegate : AnyObject

This protocol provides methods for handling actions based on the FUICalendarView State.

  • This method is called after the calendar view has scrolled. In the case of monthView, the next section is the previous month or the next month depending upon the direction of the scroll. In the case of week View, it is the next (or previous) set of 7 dates.

    Declaration

    Swift

    func calendarView(_ calendarView: FUICalendarView, didChangeVisibleDatesTo visibleDates: FUIVisibleDates)

    Parameters

    visibleDates

    The dates currently displayed on the screen.

  • This method is called when a date is selected in monthView, weeekView and expandableView styles. In the case of multipleSelectionView, this method is not called. Rather, the calendarView(: didChangeSelections:) is called any time the selected date range changes.

    Declaration

    Swift

    func calendarView(_ calendarView: FUICalendarView, didSelectDate date: Date, cell: FUICalendarItemCollectionViewCell)

    Parameters

    date

    The selected date

    cell

    FUICalendarItemCollectionViewCell of the calendarView

  • This method is called when a date is deselected in monthView, weeekView and expandableView styles. In the case of multipleSelectionView, this method is not called. Rather, the calendarView(: didChangeSelections:) is called any time the selected date range changes.

    Declaration

    Swift

    func calendarView(_ calendarView: FUICalendarView, didDeselectDate date: Date, cell: FUICalendarItemCollectionViewCell)

    Parameters

    date

    The deselected date

    cell

    FUICalendarItemCollectionViewCell of the calendarView

  • This method is called before a cell is displayed.

    Declaration

    Swift

    func calendar(_ calendarView: FUICalendarView, willDisplay cell: FUICalendarItemCollectionViewCell, forItemAt date: Date, indexPath: IndexPath)

    Parameters

    cell

    FUICalendarItemCollectionViewCell of the calendarView

    date

    The date that will be displayed in the cell.

  • This method is called each time the title is updated due to user actions such as scrolling to the next section, selecting or deselecting a date.

    Declaration

    Swift

    func calendarView(_ calendarView: FUICalendarView, didChangeTitleTo title: String)

    Parameters

    title

    The current title string

  • This method is called when a date(in monthView, weekView and expandableView) or date range(in multipleSelectionView) selection is changed.

    Declaration

    Swift

    func calendarView(_ calendarView: FUICalendarView, didChangeSelections selections: [FUIDateSelection])

    Parameters

    selections

    The array containing the FUIDateSelection objects.