Created
April 6, 2017 06:56
-
-
Save michal-majchrzycki/07014ad982e27db4b669bcc317c2fd20 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let centeredIndexPath = IndexPath.init(item: selectedDate, section: 0) | |
collectionView.scrollToItem(at: centeredIndexPath, at: .centeredHorizontally, animated: true) | |
if indexPath == centeredIndexPath { | |
collectionView.scrollToItem(at: indexPath, at: .centeredHorizontally, animated: true) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment