Skip to content

Commit

Permalink
changed order in which scrollTo executes on touch when 'scrollToEdgeE…
Browse files Browse the repository at this point in the history
…nabled'
  • Loading branch information
BenEmdon committed Jan 9, 2017
1 parent 3ad1f63 commit d12087d
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,10 @@ extension CenteredCollectionView: UICollectionViewDelegate {

// MARK: - Utilized delegate methods
public func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
delegateInterceptor?.collectionView?(collectionView, didSelectItemAt: indexPath)
if scrollToEdgeEnabled && !collectionView.isDragging && !collectionView.isDecelerating && !collectionView.isTracking && indexPath.row != currentCenteredPage {
scrollTo(page: indexPath.row, animated: true)
}
delegateInterceptor?.collectionView?(collectionView, didSelectItemAt: indexPath)
}

public func scrollViewDidEndDecelerating(_ scrollView: UIScrollView) {
Expand Down

0 comments on commit d12087d

Please sign in to comment.