I am new in swift and I am facing problem to get current indexpath
of collection view
my code is like this
func scrollViewDidEndDecelerating(_ scrollView: UIScrollView) {
for cell in SliderCollectionView.visibleCells {
let indexPath = SliderCollectionView.indexPath(for: cell)
print(indexPath)
}
}
I am getting indexPath
but like this Optional([0, 2])
But I need it as 2