Is there an event to know if the user scrolled to another month?

2 posts, 0 answers
  1. Fabio
    Fabio avatar
    20 posts
    Member since:
    Apr 2015

    Posted 04 Aug 2015 Link to this post


    I want to know if there is an event to tell if the user scrolled to another month.

    Is there an event that tells me on which month I am currently in?

    Should I implement IOnDisplayDateChangedListener like android?​


  2. Adrian
    Adrian avatar
    159 posts

    Posted 07 Aug 2015 Link to this post

    Hi Fabio,

    Thank you for contacting us.

    1. To handle scrolling to another month you should adopt TKCalendarDelegate and implement its calendar:didNavigateToDate: method. Consider the code snippet below:
    - (void)calendar:(TKCalendar *)calendar didNavigateToDate:(NSDate *)date
        // handle navigation

    2. displayedDate method of TKCalendar returns the currently displayed date. Once you have the displayed date you can easily get the month. The code snippet below demonstrate how to achieve this:
    NSDate *currentDate = _calendarView.displayedDate;
    NSCalendar *calendar = [NSCalendar currentCalendar];
    NSDateComponents *components = [calendar components:NSCalendarUnitMonth fromDate:currentDate];
    NSInteger currentMonth = components.month;

    I hope this helps. Should you have further questions, do not hesitate to contact us.

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. DevCraft banner
Back to Top