Hussein Hussein - 4 months ago 17x
iOS Question

Add calendar to iOS application

I am working on an application which needs a calendar in it. Which could be a better approach:

  1. Creating my own calendar

  2. Using a 3rd party calendar (Cocoapods eg.)


There's a page called CocoaControls where you cand find stuff like this.

Maybe you are not interested in knowing new sites and stuff so I will let you know the options.

As you can see there are lots of libraries/projects that provide classes for you to implement a calendar, Tapkulibrary is the most used, cause is the most accurate related to iOS native calendar and, the most complete.

You will need the documentation to work with this library.

It provides delegates and methods for you to take full advantage (Example of methods to get when a user taps on a date or change of month, etc.):

#pragma mark MonthView Delegate & DataSource
- (NSArray*) calendarMonthView:(TKCalendarMonthView*)monthView marksFromDate:(NSDate*)startDate toDate:(NSDate*)lastDate{
    [self generateRandomDataForStartDate:startDate endDate:lastDate];
    return self.dataArray;
- (void) calendarMonthView:(TKCalendarMonthView*)monthView didSelectDate:(NSDate*)date{
    NSLog(@"Date Selected: %@",date);
    [self.tableView reloadData];
- (void) calendarMonthView:(TKCalendarMonthView*)mv monthDidChange:(NSDate*)d animated:(BOOL)animated{
    [super calendarMonthView:mv monthDidChange:d animated:animated];
    [self.tableView reloadData];

Hope it helps.