diff --git a/FSCalendar/FSCalendar.m b/FSCalendar/FSCalendar.m index 6b2c1812..05965118 100644 --- a/FSCalendar/FSCalendar.m +++ b/FSCalendar/FSCalendar.m @@ -585,6 +585,9 @@ - (void)collectionView:(UICollectionView *)collectionView didDeselectItemAtIndex - (void)collectionView:(UICollectionView *)collectionView willDisplayCell:(UICollectionViewCell *)cell forItemAtIndexPath:(NSIndexPath *)indexPath { + if (![cell isKindOfClass:[FSCalendarCell class]]) { + return; + } NSDate *date = [self.calculator dateForIndexPath:indexPath]; FSCalendarMonthPosition monthPosition = [self.calculator monthPositionForIndexPath:indexPath]; [self.delegateProxy calendar:self willDisplayCell:(FSCalendarCell *)cell forDate:date atMonthPosition:monthPosition];