BPKCalendarDelegate

@protocol BPKCalendarDelegate <NSObject>

Delegate for configuring and respodning to interactions in a calendar.

  • Called when a date selection changed.

    Declaration

    Objective-C

    - (void)calendar:(nonnull BPKCalendar *)calendar
        didChangeDateSelection:(nonnull NSArray<BPKSimpleDate *> *)dateList;

    Swift

    func calendar(_ calendar: BPKCalendar!, didChangeDateSelection dateList: Any!)

    Parameters

    calendar

    The backpack calendar.

    dateList

    List of selected dates.

  • Called when the calendar was scrolled

    Declaration

    Objective-C

    - (void)calendar:(nonnull BPKCalendar *)calendar
           didScroll:(CGPoint)contentOffset;

    Swift

    optional func calendar(_ calendar: BPKCalendar!, didScroll contentOffset: Any!)

    Parameters

    calendar

    The backpack calendar.

    contentOffset

    The content offset

  • Called when the calendar renders each cell.

    Declaration

    Objective-C

    - (BOOL)calendar:(nonnull BPKCalendar *)calendar
        isDateEnabled:(nonnull BPKSimpleDate *)date;

    Swift

    optional func calendar(_ calendar: BPKCalendar!, isDateEnabled date: BPKSimpleDate!) -> Any!

    Parameters

    calendar

    The backpack calendar.

    date

    The date to check for enabledness.

    Return Value

    Whether the cell for the given date is enabled.

  • Asks the delegate for cell data for a specific date.

    Declaration

    Objective-C

    - (id _Nullable)calendar:(nonnull BPKCalendar *)calendar
             cellDataForDate:(nonnull BPKSimpleDate *)date;

    Swift

    optional func calendar(_ calendar: BPKCalendar!, cellDataFor date: BPKSimpleDate!) -> Any?

    Parameters

    calendar

    The backpack calendar requesting the data.

    date

    The date to provide the data for.

    Return Value

    The cell data to use for this date.