Deselect current

Deselect current
This commit is contained in:
DingWenchao 2015-06-26 08:46:33 +08:00
parent dc45d7ae98
commit 1002377b43
1 changed files with 5 additions and 0 deletions

View File

@ -374,6 +374,11 @@
selectedDate = [selectedDate fs_daysFrom:_maximumDate] > 0 ? [NSDate fs_dateWithYear:_maximumDate.fs_year month:_maximumDate.fs_month day:selectedDate.fs_day] : selectedDate;
NSIndexPath *selectedIndexPath = [self indexPathForDate:selectedDate];
if ([self collectionView:_collectionView shouldSelectItemAtIndexPath:selectedIndexPath]) {
if (_collectionView.indexPathsForSelectedItems.count && _selectedDate) {
NSIndexPath *currentIndexPath = [self indexPathForDate:_selectedDate];
[_collectionView deselectItemAtIndexPath:currentIndexPath animated:YES];
[self collectionView:_collectionView didDeselectItemAtIndexPath:currentIndexPath];
}
[_collectionView selectItemAtIndexPath:selectedIndexPath animated:NO scrollPosition:UICollectionViewScrollPositionNone];
[self collectionView:_collectionView didSelectItemAtIndexPath:selectedIndexPath];
}