From 93f6e9fd2105a1f6aca4ea3a74ed5e11f4e9d8fa Mon Sep 17 00:00:00 2001 From: JayT Date: Wed, 31 May 2017 07:57:27 -0700 Subject: [PATCH] Changed the order in which delegates are called https://github.com/patchthecode/JTAppleCalendar/issues/431 --- Sources/UICollectionViewDelegates.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/UICollectionViewDelegates.swift b/Sources/UICollectionViewDelegates.swift index 379c62e4..f6c0d06e 100644 --- a/Sources/UICollectionViewDelegates.swift +++ b/Sources/UICollectionViewDelegates.swift @@ -125,10 +125,10 @@ extension JTAppleCalendarView: UICollectionViewDelegate, UICollectionViewDataSou let counterPathsToReload = isRangeSelectionUsed ? Set(validForwardAndBackwordSelectedIndexes(forIndexPath: selectedCounterPartIndexPath)) : [] pathsToReload.formUnion(counterPathsToReload) } + delegate.calendar(self, didSelectDate: infoOfDateSelectedByUser.date, cell: selectedCell, cellState: cellState) if !pathsToReload.isEmpty { self.batchReloadIndexPaths(Array(pathsToReload)) } - delegate.calendar(self, didSelectDate: infoOfDateSelectedByUser.date, cell: selectedCell, cellState: cellState) } /// Tells the delegate that the item at the specified path was deselected. @@ -155,10 +155,10 @@ extension JTAppleCalendarView: UICollectionViewDelegate, UICollectionViewDataSou let counterPathsToReload = isRangeSelectionUsed ? Set(validForwardAndBackwordSelectedIndexes(forIndexPath: unselectedCounterPartIndexPath)) : [] indexPathsToReload.formUnion(counterPathsToReload) } + delegate.calendar(self, didDeselectDate: dateInfoDeselectedByUser.date, cell: selectedCell, cellState: cellState) if indexPathsToReload.count > 0 { self.batchReloadIndexPaths(Array(indexPathsToReload)) } - delegate.calendar(self, didDeselectDate: dateInfoDeselectedByUser.date, cell: selectedCell, cellState: cellState) } }