How to scroll to a particluar index in collection view in swift

In viewDidLoad of your controller, you can write the code for scrolling to a particular index path of collection view.

self.collectionView.scrollToItem(at:IndexPath(item: indexNumber, section: sectionNumber), at: .right, animated: false)

Leave a Comment