Skip to content

Commit

Permalink
Changed the order in which delegates are called
Browse files Browse the repository at this point in the history
  • Loading branch information
patchthecode committed May 31, 2017
1 parent 9d84d46 commit 93f6e9f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Sources/UICollectionViewDelegates.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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)
}
}

Expand Down

0 comments on commit 93f6e9f

Please sign in to comment.