From 7ac5cb9430bbd90cd5580b2bf021ed03ec60a3c7 Mon Sep 17 00:00:00 2001 From: WenchaoD Date: Wed, 1 Mar 2017 21:53:43 +0800 Subject: [PATCH] Fix willDisplay --- FSCalendar/FSCalendar.m | 3 +++ 1 file changed, 3 insertions(+) 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];