I have used collectionview to show models as well as years and the user can swipe the cells.
The cell which is selected would be positioned to center not depending on number of items.
Any help would be highly appreciated.
SOL 1:
collectionView.scrollToItemAtIndexPath(indexPath, atScrollPosition: .centeredHorizontally, animated: true)
SOL 2: I suggest you add empty items at the beginning and end. So the user can scroll the first and last visible item to the centre.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With