Skip to content

Commit d12087d

Browse files
committed
changed order in which scrollTo executes on touch when 'scrollToEdgeEnabled'
1 parent 3ad1f63 commit d12087d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

CenteredCollectionView/Classes/CenteredCollectionView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,10 @@ extension CenteredCollectionView: UICollectionViewDelegate {
109109

110110
// MARK: - Utilized delegate methods
111111
public func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
112+
delegateInterceptor?.collectionView?(collectionView, didSelectItemAt: indexPath)
112113
if scrollToEdgeEnabled && !collectionView.isDragging && !collectionView.isDecelerating && !collectionView.isTracking && indexPath.row != currentCenteredPage {
113114
scrollTo(page: indexPath.row, animated: true)
114115
}
115-
delegateInterceptor?.collectionView?(collectionView, didSelectItemAt: indexPath)
116116
}
117117

118118
public func scrollViewDidEndDecelerating(_ scrollView: UIScrollView) {

0 commit comments

Comments
 (0)