This is a migrated thread and some comments may be shown as answers.

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

1 Answer 25 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Fabio
Top achievements
Rank 1
Fabio asked on 05 Aug 2015, 03:44 AM

Hello

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?​

 

1 Answer, 1 is accepted

Sort by
0
Adrian
Telerik team
answered on 07 Aug 2015, 03:08 PM
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.

Regards,
Adrian
Telerik
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
Tags
Calendar
Asked by
Fabio
Top achievements
Rank 1
Answers by
Adrian
Telerik team
Share this question
or