Note that there are some explanatory texts on larger screens.

plurals
  1. POKAL Calendar, how to implement KalDataSource so as I can show events which are in iOS in-built Calendar app?
    text
    copied!<p>I have integrated Kal Calendar in my app successfully, here is the method how I show the calendar</p> <pre><code>-(void)showDepartDatePicker{ NSLog(@"showDepartDatePicker"); if(_departDatePicker != nil){ [self.navigationController pushViewController:_departDatePicker animated:YES]; }else{ _departDatePicker = [[KalViewController alloc] init]; _departDatePicker.title = @"Departure Date"; _departDatePicker.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"Today" style:UIBarButtonItemStyleBordered target:self action:@selector(showAndSelectTodayDeparturePicker)]; _departDatePicker.kvcDelegate = self; [self.navigationController pushViewController:_departDatePicker animated:YES]; } } </code></pre> <p>I have added following in KalViewController.h,</p> <pre><code>@protocol KalViewControllerDelegate &lt;NSObject&gt; @required - (void)didSelectDate:(KalDate *)date andLoaded:(BOOL)loaded; @end </code></pre> <p>and</p> <pre><code>@property (nonatomic, assign) id &lt;KalViewControllerDelegate&gt; kvcDelegate; </code></pre> <p>and implemented this delegate method in my viewController as</p> <pre><code>- (void)didSelectDate:(KalDate *)date andLoaded:(BOOL)loaded { NSLog(@"Title : %@",[self.navigationController.visibleViewController title]); [self.navigationController popViewControllerAnimated:YES]; } </code></pre> <p>now, as per my question, I want to implement KalDataSource so as it show the day marked with events and selecting it show the event details in the table view available below Month's View.<br> Refer this link if you are new for Kal Calendar <a href="https://github.com/klazuka/Kal" rel="nofollow">https://github.com/klazuka/Kal</a></p> <p>Second Question, here is how I call delegate method from KalViewController.m</p> <pre><code>- (void)didSelectDate:(KalDate *)date { self.selectedDate = [date NSDate]; NSDate *from = [[date NSDate] cc_dateByMovingToBeginningOfDay]; NSDate *to = [[date NSDate] cc_dateByMovingToEndOfDay]; [self clearTable]; [dataSource loadItemsFromDate:from toDate:to]; [tableView reloadData]; [tableView flashScrollIndicators]; //line below calls my delegate method [self.kvcDelegate didSelectDate:date andLoaded:_loaded]; } </code></pre> <p>What happens is, when I call showDepartDatePicker to push KalViewController to my navigation stack, it calls my delegate method 2 times(which should be called on date selection), then for every date selection calls that delegate method again(1 time). <br><br> Even I want to limit this calendar not to show past dates! Please help me out on this.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload