Kal Calendar Walkthrough

3k Views Asked by At

I am new to obj c and I am not understanding how to use Kal Calendar. Would anyone be willing to help a new app developer walk through the process? I have it installed to my app but don't know how to use it. I understand if you don't respond, I cant find any tutorials on it and google only helped a little.

I am using ios5, storyboards and arc. Thanks in advance.

I had to subclass the calendar with storyboards, is this the best way? I cant get it to display with a navbar any other way.

UPDATED-I don't think subclass is the way to go but I am still working on a solution

1

There are 1 best solutions below

11
On BEST ANSWER

I created a view controller to contain the calendar view controller(KalViewController). That view controller is the KalViewControllerDelegate and datasource. I add the KalViewController as a child view controller using the containment introduced on iOS 5. I added the parent view controller of the KalViewController to a popover controller (on an iPad application). I present it from where I wanted to (UIBarButtonItem). The job of the parent view controller is to provide dates for the calendar view, and to provide data to the table view.

Edit: Here's what you need to do:

on

- (void)presentingDatesFrom:(NSDate *)fromDate to:(NSDate *)toDate delegate:(id<KalDataSourceCallbacks>)delegate

You need to find your dates (Network, database, etc). Once you fetch the information containing the dates, you call [delegate loadedDataSource:self];

- (NSArray *)markedDatesFrom:(NSDate *)fromDate to:(NSDate *)toDate

This is to show the dates that are marked on the calendar (the ones with the little dot to mark an event on a particular day). Here you use the dates from your model to find the ones that are going to be visible on the calendar for a month.

- (void)loadItemsFromDate:(NSDate *)fromDate toDate:(NSDate *)toDate

This will be called when the user selects a day of a month. This should be used to update the list of objects being shown on the tableview datasource. So, if you keep an array with the dates for the calendar table, update the array with the data for the given day.

and finally:

- (void)removeAllItems

clear your tableview datasource array.

You also have to implement the Calendar's tableview datasource and delegate methods.