From 0a88f0a1e47fbf9b28ac6da73cd9fe67ffe99efd Mon Sep 17 00:00:00 2001 From: WenchaoD Date: Fri, 5 May 2017 12:24:26 +0800 Subject: [PATCH] Fix issue for selection state --- FSCalendar/FSCalendar.m | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/FSCalendar/FSCalendar.m b/FSCalendar/FSCalendar.m index 1e4b431..047c221 100644 --- a/FSCalendar/FSCalendar.m +++ b/FSCalendar/FSCalendar.m @@ -1550,6 +1550,12 @@ void FSCalendarRunLoopCallback(CFRunLoopObserverRef observer, CFRunLoopActivity break; } } + // Synchronize selecion state to the collection view, otherwise delegate methods would not be triggered. + if (cell.selected) { + [self.collectionView selectItemAtIndexPath:indexPath animated:NO scrollPosition:NO]; + } else { + [self.collectionView deselectItemAtIndexPath:indexPath animated:NO]; + } [self invalidateAppearanceForCell:cell forDate:date]; [cell configureAppearance];