-
Notifications
You must be signed in to change notification settings - Fork 20
Description
Hi,
Loving the calendar. I needed to select multiple dates. To do this I subclassed DFDatePickerView, and overwrote the following methods....
- (UICollectionView *) collectionView;
- (DFDatePickerDayCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath;
- (void) collectionView:(UICollectionView *)collectionView didDeselectItemAtIndexPath: (NSIndexPath *)indexPath;
- (void) collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath;Nothing to complicated, just adding/removing dates to an array and changing how a cell is displayed based on that array. Then I subclassed DFDatePickerViewController, and overwrote -(DFDatePickerView*) datePickerView to use my new subclass. An extra method in the protocol passes the array to the delegate.
This all worked fine when using it within your own dayFlow-sample project. Strangely, when moving the files over to my own project the calendar always opens 6 months in the past. I know you use +/- 6 months when first generating the collection view. However, I can't see why my project would start there, but the same code in your sample project starts in the middle (i.e. now).
I realise this is out of the scope of your project, but if you can think of any reasons why the same code in 2 apps would behave differently I would be very appreciative. Either way, I'd suggest considering allowing multiple dates to be selected, as it seems to be a gap in the 'market'.